widget: Add baseline and out_clip parameters to size-allocate
authorTimm Bäder <mail@baedert.org>
Tue, 11 Jul 2017 07:58:21 +0000 (09:58 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 20 Jul 2017 01:27:16 +0000 (21:27 -0400)
Since setting a clip is mandatory for almost all widgets, we can as well
change the size-allocate signature to include a out_clip parameter, just
like GtkCssGadget did. And since we now always propagate baselines, we
might as well pass that one on to size-allocate.

This way we can also make sure to transform the clip returned from
size-allocate to parent-coordinates, i.e. the same coordinate space
priv->allocation is in.

83 files changed:
demos/gtk-demo/application.c
demos/gtk-demo/gtkfishbowl.c
demos/gtk-demo/popover.c
docs/reference/gtk/gtk4-sections.txt
gtk/gtkaccellabel.c
gtk/gtkactionbar.c
gtk/gtkappchooserwidget.c
gtk/gtkapplicationwindow.c
gtk/gtkbbox.c
gtk/gtkbin.c
gtk/gtkbox.c
gtk/gtkbutton.c
gtk/gtkcalendar.c
gtk/gtkcellview.c
gtk/gtkcenterbox.c
gtk/gtkcheckbutton.c
gtk/gtkcheckmenuitem.c
gtk/gtkcolorbutton.c
gtk/gtkcolorplane.c
gtk/gtkcolorswatch.c
gtk/gtkcombobox.c
gtk/gtkcontainer.c
gtk/gtkentry.c
gtk/gtkeventbox.c
gtk/gtkexpander.c
gtk/gtkfilechooserbutton.c
gtk/gtkfilechooserdialog.c
gtk/gtkfilechooserwidget.c
gtk/gtkfixed.c
gtk/gtkflowbox.c
gtk/gtkfontbutton.c
gtk/gtkfontchooserwidget.c
gtk/gtkframe.c
gtk/gtkgizmo.c
gtk/gtkglarea.c
gtk/gtkgrid.c
gtk/gtkheaderbar.c
gtk/gtkicon.c
gtk/gtkiconview.c
gtk/gtkimage.c
gtk/gtkinvisible.c
gtk/gtklabel.c
gtk/gtklayout.c
gtk/gtklevelbar.c
gtk/gtklistbox.c
gtk/gtkmagnifier.c
gtk/gtkmenu.c
gtk/gtkmenubar.c
gtk/gtkmenuitem.c
gtk/gtkmodelbutton.c
gtk/gtknotebook.c
gtk/gtkoverlay.c
gtk/gtkpaned.c
gtk/gtkpathbar.c
gtk/gtkpopover.c
gtk/gtkprogressbar.c
gtk/gtkrange.c
gtk/gtkrecentchooserwidget.c
gtk/gtkrevealer.c
gtk/gtkscale.c
gtk/gtkscrollbar.c
gtk/gtkscrolledwindow.c
gtk/gtkseparator.c
gtk/gtkseparatortoolitem.c
gtk/gtkshortcutsshortcut.c
gtk/gtkspinbutton.c
gtk/gtkspinner.c
gtk/gtkstack.c
gtk/gtkswitch.c
gtk/gtktextview.c
gtk/gtktoolbar.c
gtk/gtktoolitemgroup.c
gtk/gtktoolpalette.c
gtk/gtktreeview.c
gtk/gtktreeviewcolumn.c
gtk/gtkviewport.c
gtk/gtkwidget.c
gtk/gtkwidget.h
gtk/gtkwidgetprivate.h
gtk/gtkwindow.c
gtk/inspector/gtkstackcombo.c
gtk/inspector/misc-info.c
tests/testwidgetfocus.c

index 217947f9a1a0222c927a4daff78f9adcc13756b3..d2aa1f7f4f43f6136fe867ae5f8dcd58ea00d22f 100644 (file)
@@ -455,12 +455,15 @@ demo_application_window_constructed (GObject *object)
 }
 
 static void
-demo_application_window_size_allocate (GtkWidget     *widget,
-                                       GtkAllocation *allocation)
+demo_application_window_size_allocate (GtkWidget           *widget,
+                                       const GtkAllocation *allocation,
+                                       int                  baseline,
+                                       GtkAllocation       *out_clip)
 {
   DemoApplicationWindow *window = (DemoApplicationWindow *)widget;
 
-  GTK_WIDGET_CLASS (demo_application_window_parent_class)->size_allocate (widget, allocation);
+  GTK_WIDGET_CLASS (demo_application_window_parent_class)->size_allocate (widget, allocation,
+                                                                          baseline, out_clip);
 
   if (!window->maximized && !window->fullscreen)
     gtk_window_get_size (GTK_WINDOW (window), &window->width, &window->height);
index d3343eb79693cb69e5843c6554c90f4f0ad97cae..a41a39c550d89f4c76eb0278396ac09f46b1ac81 100644 (file)
@@ -114,8 +114,10 @@ gtk_fishbowl_measure (GtkWidget      *widget,
 }
 
 static void
-gtk_fishbowl_size_allocate (GtkWidget     *widget,
-                            GtkAllocation *allocation)
+gtk_fishbowl_size_allocate (GtkWidget           *widget,
+                            const GtkAllocation *allocation,
+                            int                  baseline,
+                            GtkAllocation       *out_clip)
 {
   GtkFishbowl *fishbowl = GTK_FISHBOWL (widget);
   GtkFishbowlPrivate *priv = gtk_fishbowl_get_instance_private (fishbowl);
@@ -126,6 +128,8 @@ gtk_fishbowl_size_allocate (GtkWidget     *widget,
 
   for (children = priv->children; children; children = children->next)
     {
+      GtkAllocation child_clip;
+
       child = children->data;
 
       if (!gtk_widget_get_visible (child->widget))
@@ -137,10 +141,8 @@ gtk_fishbowl_size_allocate (GtkWidget     *widget,
       child_allocation.width = child_requisition.width;
       child_allocation.height = child_requisition.height;
 
-      gtk_widget_size_allocate (child->widget, &child_allocation);
+      gtk_widget_size_allocate (child->widget, &child_allocation, -1, &child_clip);
     }
-
-  gtk_widget_set_clip (widget, allocation);
 }
 
 static double
index 8f0573de96d2a6056cae0fc7761f02bcc8029c3f..a95ca1bed411988b56266ffe2704fd3b1d934d36 100644 (file)
@@ -55,8 +55,10 @@ create_complex_popover (GtkWidget       *parent,
 }
 
 static void
-entry_size_allocate_cb (GtkEntry      *entry,
-                        GtkAllocation *allocation,
+entry_size_allocate_cb (GtkEntry            *entry,
+                        const GtkAllocation *allocation,
+                        int                  baseline,
+                        GtkAllocation       *out_clip,
                         gpointer       user_data)
 {
   GtkEntryIconPosition popover_pos;
index 66bcd1bdeebf1eb6ce0f305fd4e7d675d16eaa62..b472333e31884d4a1469d0aa83090134c6a6fafd 100644 (file)
@@ -4529,7 +4529,6 @@ GtkTickCallback
 gtk_widget_add_tick_callback
 gtk_widget_remove_tick_callback
 gtk_widget_size_allocate
-gtk_widget_size_allocate_with_baseline
 gtk_widget_add_accelerator
 gtk_widget_remove_accelerator
 gtk_widget_set_accel_path
index bb5cac80cc6ecfc01f2ea7a869a8eda4c5d7805a..8eac6d5f460b4cb9f10d4b41b69efc4a3434d7d4 100644 (file)
@@ -159,13 +159,15 @@ static void gtk_accel_label_measure (GtkWidget      *widget,
 G_DEFINE_TYPE_WITH_PRIVATE (GtkAccelLabel, gtk_accel_label, GTK_TYPE_WIDGET)
 
 static void
-gtk_accel_label_size_allocate (GtkWidget     *widget,
-                               GtkAllocation *allocation)
+gtk_accel_label_size_allocate (GtkWidget           *widget,
+                               const GtkAllocation *allocation,
+                               int                   baseline,
+                               GtkAllocation        *out_clip)
 {
   GtkAccelLabel *al = GTK_ACCEL_LABEL (widget);
   GtkAccelLabelPrivate *priv = gtk_accel_label_get_instance_private (al);
 
-  gtk_widget_size_allocate (priv->box, allocation);
+  gtk_widget_size_allocate (priv->box, allocation, baseline, out_clip);
 }
 
 static void
index c645769f2e6ee9b176966e728e798b7d9524891f..569d740b5badb60776af4d7af3de331ba608e376 100644 (file)
@@ -268,16 +268,13 @@ gtk_action_bar_snapshot (GtkWidget   *widget,
 }
 
 static void
-gtk_action_bar_size_allocate (GtkWidget     *widget,
-                              GtkAllocation *allocation)
+gtk_action_bar_size_allocate (GtkWidget           *widget,
+                              const GtkAllocation *allocation,
+                              int                  baseline,
+                              GtkAllocation       *out_clip)
 {
   GtkActionBarPrivate *priv = gtk_action_bar_get_instance_private (GTK_ACTION_BAR (widget));
-  GtkAllocation clip = *allocation;
-
-  gtk_widget_size_allocate (priv->revealer, (GtkAllocation *)allocation);
-  gtk_widget_get_clip (priv->revealer, &clip);
-
-  gtk_widget_set_clip (widget, &clip);
+  gtk_widget_size_allocate (priv->revealer, allocation, baseline, out_clip);
 }
 
 static void
index 9086bfbb0ed4c86a976fae4c835a413d25cfa59f..1cd3b1458b3c26a0e7590e1aa46fae91b7eddf1e 100644 (file)
@@ -971,15 +971,17 @@ gtk_app_chooser_widget_snapshot (GtkWidget   *widget,
 }
 
 static void
-gtk_app_chooser_widget_size_allocate (GtkWidget     *widget,
-                                      GtkAllocation *allocation)
+gtk_app_chooser_widget_size_allocate (GtkWidget           *widget,
+                                      const GtkAllocation *allocation,
+                                      int                  baseline,
+                                      GtkAllocation       *out_clip)
 {
   GtkAppChooserWidget *self = GTK_APP_CHOOSER_WIDGET (widget);
   GtkAppChooserWidgetPrivate *priv = gtk_app_chooser_widget_get_instance_private (self);
 
-  GTK_WIDGET_CLASS (gtk_app_chooser_widget_parent_class)->size_allocate (widget, allocation);
+  GTK_WIDGET_CLASS (gtk_app_chooser_widget_parent_class)->size_allocate (widget, allocation, baseline, out_clip);
 
-  gtk_widget_size_allocate (priv->overlay, allocation);
+  gtk_widget_size_allocate (priv->overlay, allocation, baseline, out_clip);
 }
 
 static void
index c0094c3d6a72e69f8fe368df957e1ec4ded47ab5..daa66e3c7abfad914591088791d86f29c5475793 100644 (file)
@@ -594,8 +594,10 @@ gtk_application_window_measure (GtkWidget *widget,
 }
 
 static void
-gtk_application_window_real_size_allocate (GtkWidget     *widget,
-                                           GtkAllocation *allocation)
+gtk_application_window_real_size_allocate (GtkWidget           *widget,
+                                           const GtkAllocation *allocation,
+                                           int                  baseline,
+                                           GtkAllocation       *out_clip)
 {
   GtkApplicationWindow *window = GTK_APPLICATION_WINDOW (widget);
 
@@ -614,19 +616,19 @@ gtk_application_window_real_size_allocate (GtkWidget     *widget,
                           &menubar_height, NULL, NULL, NULL);
 
       menubar_allocation.height = menubar_height;
-      gtk_widget_size_allocate (window->priv->menubar, &menubar_allocation);
+      gtk_widget_size_allocate  (window->priv->menubar, &menubar_allocation, baseline, out_clip);
 
       child_allocation.y += menubar_height;
       child_allocation.height -= menubar_height;
       child = gtk_bin_get_child (GTK_BIN (window));
       if (child != NULL && gtk_widget_get_visible (child))
-        gtk_widget_size_allocate (child, &child_allocation);
+        gtk_widget_size_allocate (child, &child_allocation, baseline, out_clip);
     }
   else
-    GTK_WIDGET_CLASS (gtk_application_window_parent_class)
-      ->size_allocate (widget, allocation);
-
-  gtk_widget_set_clip (widget, allocation);
+    GTK_WIDGET_CLASS (gtk_application_window_parent_class)->size_allocate (widget,
+                                                                           allocation,
+                                                                           baseline,
+                                                                           out_clip);
 }
 
 static void
index f35f67e23b05aef6e41180a7319a8a5dc3c90daa..2661001935d933e1ae6a3f699c9a5d460e8e03ed 100644 (file)
@@ -97,8 +97,10 @@ static void gtk_button_box_measure           (GtkWidget         *widget,
                                               int               *natural,
                                               int               *minimum_baseline,
                                               int               *natural_baseline);
-static void gtk_button_box_size_allocate      (GtkWidget         *widget,
-                                               GtkAllocation     *allocation);
+static void gtk_button_box_size_allocate      (GtkWidget           *widget,
+                                               const GtkAllocation *allocation,
+                                               int                  baseline,
+                                               GtkAllocation       *out_clip);
 static void gtk_button_box_remove             (GtkContainer      *container,
                                                GtkWidget         *widget);
 static void gtk_button_box_set_child_property (GtkContainer      *container,
@@ -742,8 +744,10 @@ gtk_button_box_measure (GtkWidget      *widget,
 }
 
 static void
-gtk_button_box_size_allocate (GtkWidget     *widget,
-                              GtkAllocation *allocation)
+gtk_button_box_size_allocate (GtkWidget           *widget,
+                              const GtkAllocation *allocation,
+                              int                  baseline,
+                              GtkAllocation       *out_clip)
 {
   GtkButtonBox *bbox = GTK_BUTTON_BOX (widget);
   GtkButtonBoxPrivate *priv = bbox->priv;
@@ -769,15 +773,16 @@ gtk_button_box_size_allocate (GtkWidget     *widget,
   gint secondary_size;
   gint total_size;
   gint baseline_height;
-  gint baseline;
   gint child_baseline;
   gint i;
-  GtkAllocation clip = *allocation;
   GdkRectangle child_clip;
 
   if (priv->layout_style == GTK_BUTTONBOX_EXPAND)
     {
-      GTK_WIDGET_CLASS (gtk_button_box_parent_class)->size_allocate (widget, allocation);
+      GTK_WIDGET_CLASS (gtk_button_box_parent_class)->size_allocate (widget,
+                                                                     allocation,
+                                                                     baseline,
+                                                                     out_clip);
       return;
     }
 
@@ -1029,9 +1034,8 @@ gtk_button_box_size_allocate (GtkWidget     *widget,
                 }
             }
 
-          gtk_widget_size_allocate_with_baseline (child, &child_allocation, child_baseline);
-          gtk_widget_get_clip (child, &child_clip);
-          gdk_rectangle_union (&clip, &child_clip, &clip);
+          gtk_widget_size_allocate (child, &child_allocation, child_baseline, &child_clip);
+          gdk_rectangle_union (out_clip, &child_clip, out_clip);
           i++;
         }
     }
@@ -1040,8 +1044,6 @@ gtk_button_box_size_allocate (GtkWidget     *widget,
   g_free (widths);
   g_free (heights);
   g_free (baselines);
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 /**
index 0b65927d1b158468abe6d21a39ab02eadc371609..7323d075fa28c8d8cac21fb1aa37e70a62689379 100644 (file)
@@ -60,11 +60,22 @@ static void               gtk_bin_measure                         (GtkWidget
                                                                    int            *natural,
                                                                    int            *minimum_baseline,
                                                                    int            *natural_baseline);
-static void               gtk_bin_size_allocate                   (GtkWidget           *widget,
-                                                                   GtkAllocation       *allocation);
 
 G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GtkBin, gtk_bin, GTK_TYPE_CONTAINER)
 
+static void
+gtk_bin_size_allocate (GtkWidget           *widget,
+                       const GtkAllocation *allocation,
+                       int                  baseline,
+                       GtkAllocation       *out_clip)
+{
+  GtkBin *bin = GTK_BIN (widget);
+  GtkBinPrivate *priv = gtk_bin_get_instance_private (bin);
+
+  if (priv->child && gtk_widget_get_visible (priv->child))
+    gtk_widget_size_allocate (priv->child, allocation, baseline, out_clip);
+}
+
 static void
 gtk_bin_class_init (GtkBinClass *class)
 {
@@ -86,7 +97,6 @@ gtk_bin_init (GtkBin *bin)
   gtk_widget_set_has_window (GTK_WIDGET (bin), FALSE);
 }
 
-
 static GType
 gtk_bin_child_type (GtkContainer *container)
 {
@@ -181,24 +191,6 @@ gtk_bin_measure (GtkWidget *widget,
     }
 }
 
-static void
-gtk_bin_size_allocate (GtkWidget     *widget,
-                       GtkAllocation *allocation)
-{
-  GtkBin *bin = GTK_BIN (widget);
-  GtkBinPrivate *priv = gtk_bin_get_instance_private (bin);
-
-  if (priv->child && gtk_widget_get_visible (priv->child))
-    {
-      GtkAllocation clip = *allocation;
-
-      gtk_widget_size_allocate (priv->child, allocation);
-      gtk_widget_get_clip (priv->child, &clip);
-
-      gtk_widget_set_clip (widget, &clip);
-    }
-}
-
 /**
  * gtk_bin_get_child:
  * @bin: a #GtkBin
index 86a9ba55f9967dcb895388fb102517645b2d513a..194c98ba04b34645e49eea6df597969edebb8ec0 100644 (file)
@@ -142,7 +142,9 @@ struct _GtkBoxChild
 };
 
 static void gtk_box_size_allocate         (GtkWidget              *widget,
-                                           GtkAllocation          *allocation);
+                                           const GtkAllocation    *allocation,
+                                           int                     baseline,
+                                           GtkAllocation          *out_clip);
 
 static void gtk_box_direction_changed  (GtkWidget        *widget,
                                         GtkTextDirection  previous_direction);
@@ -369,6 +371,7 @@ get_spacing (GtkBox *box)
 static void
 gtk_box_size_allocate_no_center (GtkWidget           *widget,
                                  const GtkAllocation *allocation,
+                                 int                  baseline,
                                  GdkRectangle        *out_clip)
 {
   GtkBox *box = GTK_BOX (widget);
@@ -385,7 +388,6 @@ gtk_box_size_allocate_no_center (GtkWidget           *widget,
   gint minimum_above, natural_above;
   gint minimum_below, natural_below;
   gboolean have_baseline;
-  int baseline = -1;
 
   GtkPackType packing;
 
@@ -550,8 +552,8 @@ gtk_box_size_allocate_no_center (GtkWidget           *widget,
        }
     }
 
-  if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
-    baseline = gtk_widget_get_allocated_baseline (widget);
+  if (private->orientation == GTK_ORIENTATION_VERTICAL)
+    baseline = -1;
 
   /* we only calculate our own baseline if we don't get one passed from the parent
    * and any of the child widgets explicitly request one */
@@ -656,8 +658,7 @@ gtk_box_size_allocate_no_center (GtkWidget           *widget,
                  child_allocation.y -= child_size;
                }
            }
-         gtk_widget_size_allocate_with_baseline (child->widget, &child_allocation, baseline);
-          gtk_widget_get_clip (child->widget, &clip);
+         gtk_widget_size_allocate (child->widget, &child_allocation, baseline, &clip);
           gdk_rectangle_union (&clip, out_clip, out_clip);
 
          i++;
@@ -666,14 +667,12 @@ gtk_box_size_allocate_no_center (GtkWidget           *widget,
 }
 
 static void
-gtk_box_size_allocate (GtkWidget     *widget,
-                       GtkAllocation *allocation)
+gtk_box_size_allocate (GtkWidget           *widget,
+                       const GtkAllocation *allocation,
+                       int                  baseline,
+                       GtkAllocation       *out_clip)
 {
-  GtkAllocation clip = *allocation;
-
-  gtk_box_size_allocate_no_center (widget, allocation, &clip);
-
-  gtk_widget_set_clip (widget, &clip);
+  gtk_box_size_allocate_no_center (widget, allocation, baseline, out_clip);
 }
 
 static GType
index d663d1294ae36341c7150bd52b6990d357cf6cdc..ad6c3df3de564a8c7b1388e4e21a1a4209a7e4a6 100644 (file)
@@ -119,8 +119,6 @@ static void gtk_button_get_property   (GObject            *object,
 static void gtk_button_screen_changed (GtkWidget          *widget,
                                       GdkScreen          *previous_screen);
 static void gtk_button_unrealize (GtkWidget * widget);
-static void gtk_button_size_allocate (GtkWidget * widget,
-                                     GtkAllocation * allocation);
 static gint gtk_button_grab_broken (GtkWidget * widget,
                                    GdkEventGrabBroken * event);
 static gint gtk_button_key_release (GtkWidget * widget, GdkEventKey * event);
@@ -208,7 +206,6 @@ gtk_button_class_init (GtkButtonClass *klass)
   widget_class->measure = gtk_button_measure_;
   widget_class->screen_changed = gtk_button_screen_changed;
   widget_class->unrealize = gtk_button_unrealize;
-  widget_class->size_allocate = gtk_button_size_allocate;
   widget_class->grab_broken_event = gtk_button_grab_broken;
   widget_class->key_release_event = gtk_button_key_release;
   widget_class->enter_notify_event = gtk_button_enter_notify;
@@ -752,24 +749,6 @@ gtk_button_unrealize (GtkWidget *widget)
   GTK_WIDGET_CLASS (gtk_button_parent_class)->unrealize (widget);
 }
 
-static void
-gtk_button_size_allocate (GtkWidget     *widget,
-                         GtkAllocation *allocation)
-{
-  GtkAllocation clip = *allocation;
-  GtkWidget *child;
-
-  child = gtk_bin_get_child (GTK_BIN (widget));
-  if (child && gtk_widget_get_visible (child))
-    {
-      gtk_widget_size_allocate_with_baseline (child, allocation,
-                                              gtk_widget_get_allocated_baseline (widget));
-      gtk_widget_get_clip (child, &clip);
-    }
-
-  gtk_widget_set_clip (widget, &clip);
-}
-
 static void
 gtk_button_do_release (GtkButton *button,
                        gboolean   emit_clicked)
index 4defe6ecab206225a3e2bcfe2e02ea79359ba436..b9b55ddc042045a674eda11e531f6fb9c8b67729 100644 (file)
@@ -264,8 +264,10 @@ static void     gtk_calendar_measure        (GtkWidget        *widget,
                                              int            *natural,
                                              int            *minimum_baseline,
                                              int            *natural_baseline);
-static void     gtk_calendar_size_allocate  (GtkWidget        *widget,
-                                             GtkAllocation    *allocation);
+static void     gtk_calendar_size_allocate  (GtkWidget           *widget,
+                                             const GtkAllocation *allocation,
+                                             int                  baseline,
+                                             GtkAllocation       *out_clip);
 static void     gtk_calendar_snapshot       (GtkWidget        *widget,
                                              GtkSnapshot      *snapshot);
 static gboolean gtk_calendar_button_press   (GtkWidget        *widget,
@@ -1823,8 +1825,10 @@ gtk_calendar_measure (GtkWidget        *widget,
 }
 
 static void
-gtk_calendar_size_allocate (GtkWidget     *widget,
-                            GtkAllocation *allocation)
+gtk_calendar_size_allocate (GtkWidget           *widget,
+                            const GtkAllocation *allocation,
+                            int                  baseline,
+                            GtkAllocation       *out_clip)
 {
   GtkCalendar *calendar = GTK_CALENDAR (widget);
   GtkCalendarPrivate *priv = calendar->priv;
@@ -1853,9 +1857,6 @@ gtk_calendar_size_allocate (GtkWidget     *widget,
                          - (DAY_XSEP * 6))/7;
       priv->week_width = 0;
     }
-
-
-  gtk_widget_set_clip (widget, allocation);
 }
 
 
index 6c02a230e162b25aa7b5cb1aa1ed8997595654f8..b3ffecc09d30bf09ccbc7dc028922525a94157aa 100644 (file)
@@ -66,8 +66,10 @@ static void        gtk_cell_view_set_property             (GObject          *obj
                                                            GParamSpec       *pspec);
 static void        gtk_cell_view_finalize                 (GObject          *object);
 static void        gtk_cell_view_dispose                  (GObject          *object);
-static void        gtk_cell_view_size_allocate            (GtkWidget        *widget,
-                                                           GtkAllocation    *allocation);
+static void        gtk_cell_view_size_allocate            (GtkWidget           *widget,
+                                                           const GtkAllocation *allocation,
+                                                           int                  baseline,
+                                                           GtkAllocation       *out_clip);
 static void        gtk_cell_view_snapshot                 (GtkWidget        *widget,
                                                            GtkSnapshot      *snapshot);
 static void        gtk_cell_view_set_value                (GtkCellView     *cell_view,
@@ -458,8 +460,10 @@ gtk_cell_view_dispose (GObject *object)
 }
 
 static void
-gtk_cell_view_size_allocate (GtkWidget     *widget,
-                             GtkAllocation *allocation)
+gtk_cell_view_size_allocate (GtkWidget           *widget,
+                             const GtkAllocation *allocation,
+                             int                  baseline,
+                             GtkAllocation       *out_clip)
 {
   GtkCellView *cellview;
   GtkCellViewPrivate *priv;
@@ -486,8 +490,6 @@ gtk_cell_view_size_allocate (GtkWidget     *widget,
     gtk_cell_area_context_allocate (priv->context, width, -1);
   else if (alloc_height != allocation->height && priv->orientation == GTK_ORIENTATION_VERTICAL)
     gtk_cell_area_context_allocate (priv->context, -1, height);
-
-  gtk_widget_set_clip (widget, allocation);
 }
 
 static void
index ee2fa3592e9c1c0265ac2d7fda18964fc8d3da32..c5fca1cde61c177e71ff7ef8cbb19c9474eb766a 100644 (file)
@@ -379,12 +379,13 @@ gtk_center_box_measure (GtkWidget      *widget,
 }
 
 static void
-gtk_center_box_size_allocate (GtkWidget     *widget,
-                              GtkAllocation *allocation)
+gtk_center_box_size_allocate (GtkWidget           *widget,
+                              const GtkAllocation *allocation,
+                              int                  baseline,
+                              GtkAllocation       *out_clip)
 {
   GtkCenterBox *self = GTK_CENTER_BOX (widget);
   GtkAllocation child_allocation;
-  GtkAllocation clip = *allocation;
   GtkAllocation child_clip;
   GtkWidget *child[3];
   int child_size[3];
@@ -392,16 +393,12 @@ gtk_center_box_size_allocate (GtkWidget     *widget,
   GtkRequestedSize sizes[3];
   int size;
   int for_size;
-  int baseline;
   int i;
 
-  GTK_WIDGET_CLASS (gtk_center_box_parent_class)->size_allocate (widget, allocation);
-
   if (self->orientation == GTK_ORIENTATION_HORIZONTAL)
     {
       size = allocation->width;
       for_size = allocation->height;
-      baseline = gtk_widget_get_allocated_baseline (widget);
     }
   else
     {
@@ -528,12 +525,9 @@ gtk_center_box_size_allocate (GtkWidget     *widget,
           child_allocation.height = child_size[i];
         }
 
-      gtk_widget_size_allocate_with_baseline (child[i], &child_allocation, allocation->y + baseline);
-      gtk_widget_get_clip (child[i], &child_clip);
-      gdk_rectangle_union (&clip, &clip, &child_clip);
+      gtk_widget_size_allocate (child[i], &child_allocation, allocation->y + baseline, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
     }
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 static void
index 3881db55dd6337c5a5b8f1a0cd8dd648c5cf90df..b42b158f9baf35f65e886ff81750a7e016f74f78 100644 (file)
@@ -78,7 +78,9 @@
 
 
 static void gtk_check_button_size_allocate       (GtkWidget           *widget,
-                                                 GtkAllocation       *allocation);
+                                                  const GtkAllocation *allocation,
+                                                  int                  baseline,
+                                                  GtkAllocation       *out_clip);
 
 typedef struct {
   GtkWidget *indicator_widget;
@@ -432,12 +434,13 @@ gtk_check_button_new_with_mnemonic (const gchar *label)
 }
 
 static void
-gtk_check_button_size_allocate (GtkWidget     *widget,
-                               GtkAllocation *allocation)
+gtk_check_button_size_allocate (GtkWidget           *widget,
+                                const GtkAllocation *allocation,
+                                int                  baseline,
+                                GtkAllocation       *out_clip)
 {
   GtkCheckButtonPrivate *priv = gtk_check_button_get_instance_private (GTK_CHECK_BUTTON (widget));
   GtkAllocation child_alloc = { 0 };
-  GdkRectangle clip = *allocation;
   GdkRectangle child_clip;
   GtkWidget *child;
   gboolean is_rtl = _gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
@@ -462,9 +465,8 @@ gtk_check_button_size_allocate (GtkWidget     *widget,
           child_alloc.x = allocation->x;
         }
 
-      gtk_widget_size_allocate (priv->indicator_widget, &child_alloc);
-      gtk_widget_get_clip (priv->indicator_widget, &child_clip);
-      gdk_rectangle_union (&clip, &child_clip, &clip);
+      gtk_widget_size_allocate (priv->indicator_widget, &child_alloc, baseline, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
     }
 
   child = gtk_bin_get_child (GTK_BIN (widget));
@@ -475,12 +477,9 @@ gtk_check_button_size_allocate (GtkWidget     *widget,
       child_alloc.width = allocation->width - child_alloc.width; /* Indicator width */
       child_alloc.height = allocation->height;
 
-      gtk_widget_size_allocate (child, &child_alloc);
-      gtk_widget_get_clip (child, &child_clip);
-      gdk_rectangle_union (&clip, &child_clip, &clip);
+      gtk_widget_size_allocate (child, &child_alloc, baseline, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
     }
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 GtkCssNode *
index 24dd548b102308f380bbf8c90d6e844c905e1c83..0987fc18fdf2cbbde7cb329b78857e42bf65ff4c 100644 (file)
@@ -108,17 +108,21 @@ G_DEFINE_TYPE_WITH_CODE (GtkCheckMenuItem, gtk_check_menu_item, GTK_TYPE_MENU_IT
                          G_ADD_PRIVATE (GtkCheckMenuItem))
 
 static void
-gtk_check_menu_item_size_allocate (GtkWidget     *widget,
-                                   GtkAllocation *allocation)
+gtk_check_menu_item_size_allocate (GtkWidget           *widget,
+                                   const GtkAllocation *allocation,
+                                   int                  baseline,
+                                   GtkAllocation       *out_clip)
 {
-  GtkAllocation clip, widget_clip;
+  GtkAllocation child_clip;
   GtkAllocation indicator_alloc;
   GtkCheckMenuItem *check_menu_item = GTK_CHECK_MENU_ITEM (widget);
   GtkCheckMenuItemPrivate *priv = check_menu_item->priv;
   gint toggle_size;
 
-  GTK_WIDGET_CLASS (gtk_check_menu_item_parent_class)->size_allocate
-    (widget, allocation);
+  GTK_WIDGET_CLASS (gtk_check_menu_item_parent_class)->size_allocate (widget,
+                                                                      allocation,
+                                                                      baseline,
+                                                                      out_clip);
 
   gtk_widget_measure (priv->indicator_widget,
                       GTK_ORIENTATION_HORIZONTAL,
@@ -140,14 +144,11 @@ gtk_check_menu_item_size_allocate (GtkWidget     *widget,
 
   indicator_alloc.y = (allocation->height - indicator_alloc.height) / 2;
 
-  gtk_widget_size_allocate_with_baseline (priv->indicator_widget,
-                                          &indicator_alloc,
-                                          gtk_widget_get_allocated_baseline (widget));
-  gtk_widget_get_clip (priv->indicator_widget, &clip);
-
-  gtk_widget_get_clip (widget, &widget_clip);
-  gdk_rectangle_union (&widget_clip, &clip, &widget_clip);
-  gtk_widget_set_clip (widget, &widget_clip);
+  gtk_widget_size_allocate (priv->indicator_widget,
+                            &indicator_alloc,
+                            baseline,
+                            &child_clip);
+  gdk_rectangle_union (out_clip, &child_clip, out_clip);
 }
 
 static void
index bfe716b1fc0e279654fe5c74d53fee2024117133..b844d515fd841705a7c9b40870d8aa213e747837 100644 (file)
@@ -168,17 +168,15 @@ gtk_color_button_snapshot (GtkWidget   *widget,
 }
 
 static void
-gtk_color_button_size_allocate (GtkWidget     *widget,
-                                GtkAllocation *allocation)
+gtk_color_button_size_allocate (GtkWidget           *widget,
+                                const GtkAllocation *allocation,
+                                int                  baseline,
+                                GtkAllocation       *out_clip)
 {
   GtkColorButton *button = GTK_COLOR_BUTTON (widget);
   GtkColorButtonPrivate *priv = gtk_color_button_get_instance_private (button);
-  GtkAllocation clip = *allocation;
 
-  gtk_widget_size_allocate (priv->button, allocation);
-  gtk_widget_get_clip (priv->button, &clip);
-
-  gtk_widget_set_clip (widget, &clip);
+  gtk_widget_size_allocate (priv->button, allocation, baseline, out_clip);
 }
 
 static void
index addc1552dcbbd8155572b27facad5557b9b0ee63..10c2ede40de110bf2443fe5e06f3dabf2c630ff0 100644 (file)
@@ -179,13 +179,14 @@ create_surface (GtkColorPlane *plane)
 }
 
 static void
-plane_size_allocate (GtkWidget     *widget,
-                     GtkAllocation *allocation)
+plane_size_allocate (GtkWidget           *widget,
+                     const GtkAllocation *allocation,
+                     int                   baseline,
+                     GtkAllocation        *out_clip)
 {
   GtkColorPlane *plane = GTK_COLOR_PLANE (widget);
 
   create_surface (plane);
-  gtk_widget_set_clip (widget, allocation);
 }
 
 static void
index 507039c60d742a177249716276fb58cc79b86098..e24fa2e21f6de6418991c3ebe87dbade7ac40d3a 100644 (file)
@@ -380,18 +380,13 @@ tap_action (GtkGestureMultiPress *gesture,
 }
 
 static void
-swatch_size_allocate (GtkWidget     *widget,
-                      GtkAllocation *allocation)
+swatch_size_allocate (GtkWidget           *widget,
+                      const GtkAllocation *allocation,
+                      int                  baseline,
+                      GtkAllocation       *out_clip)
 {
   GtkColorSwatch *swatch = GTK_COLOR_SWATCH (widget);
-  GtkAllocation clip = *allocation, clip2 = *allocation;
-
-
-  gtk_widget_size_allocate (swatch->priv->overlay_widget, allocation);
-  gtk_widget_get_clip (swatch->priv->overlay_widget, &clip2);
-  gdk_rectangle_union (&clip, &clip2, &clip);
-
-  gtk_widget_set_clip (widget, &clip);
+  gtk_widget_size_allocate (swatch->priv->overlay_widget, allocation, -1, out_clip);
 }
 
 static void
index f5c7ce4a04d0f99641b74aae9fd5f23185902110..ce4097b7919e97a732e51157933535738b6cb256 100644 (file)
@@ -367,17 +367,15 @@ gtk_combo_box_measure (GtkWidget      *widget,
 }
 
 static void
-gtk_combo_box_size_allocate (GtkWidget     *widget,
-                             GtkAllocation *allocation)
+gtk_combo_box_size_allocate (GtkWidget           *widget,
+                             const GtkAllocation *allocation,
+                             int                  baseline,
+                             GtkAllocation       *out_clip)
 {
   GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
   GtkComboBoxPrivate *priv = combo_box->priv;
-  GtkAllocation clip = *allocation;
 
-  gtk_widget_size_allocate_with_baseline (priv->box, allocation,
-                                          gtk_widget_get_allocated_baseline (widget));
-
-  gtk_widget_get_clip (priv->box, &clip);
+  gtk_widget_size_allocate (priv->box, allocation, baseline, out_clip);
 
   if (gtk_widget_get_visible (priv->popup_widget))
     {
@@ -401,8 +399,6 @@ gtk_combo_box_size_allocate (GtkWidget     *widget,
       /* reposition the menu after giving it a new width */
       gtk_menu_reposition (GTK_MENU (priv->popup_widget));
     }
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 static void
index 8180939f17b5649c8a11178ea77155f7a827da61..0a2dbf9aec426fdb5c40ebff4236d839af2bfdd6 100644 (file)
@@ -1818,6 +1818,7 @@ gtk_container_real_check_resize (GtkContainer *container)
     {
       if (!_gtk_widget_is_toplevel (widget))
         {
+          GtkAllocation clip;
           gtk_widget_get_preferred_size (widget, &requisition, NULL);
           gtk_widget_get_allocated_size (widget, &allocation, &baseline);
 
@@ -1825,7 +1826,7 @@ gtk_container_real_check_resize (GtkContainer *container)
             allocation.width = requisition.width;
           if (allocation.height < requisition.height)
             allocation.height = requisition.height;
-          gtk_widget_size_allocate_with_baseline (widget, &allocation, baseline);
+          gtk_widget_size_allocate (widget, &allocation, baseline, &clip);
         }
       else
         gtk_widget_queue_resize (widget);
index baaa6906d7f8b8f069dbcb1632830609ceccb157..478092011a27d428b51ed257001216d6e1f594a6 100644 (file)
@@ -398,8 +398,10 @@ static void   gtk_entry_realize              (GtkWidget        *widget);
 static void   gtk_entry_unrealize            (GtkWidget        *widget);
 static void   gtk_entry_map                  (GtkWidget        *widget);
 static void   gtk_entry_unmap                (GtkWidget        *widget);
-static void   gtk_entry_size_allocate        (GtkWidget        *widget,
-                                             GtkAllocation    *allocation);
+static void   gtk_entry_size_allocate        (GtkWidget           *widget,
+                                              const GtkAllocation *allocation,
+                                              int                  baseline,
+                                              GtkAllocation       *out_clip);
 static void   gtk_entry_snapshot             (GtkWidget        *widget,
                                               GtkSnapshot      *snapshot);
 static gboolean gtk_entry_event              (GtkWidget        *widget,
@@ -3101,17 +3103,17 @@ gtk_entry_measure (GtkWidget      *widget,
 }
 
 static void
-gtk_entry_size_allocate (GtkWidget     *widget,
-                         GtkAllocation *allocation)
+gtk_entry_size_allocate (GtkWidget           *widget,
+                         const GtkAllocation *allocation,
+                         int                  baseline,
+                         GtkAllocation       *out_clip)
 {
   GtkEntry *entry = GTK_ENTRY (widget);
   GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
-  GdkRectangle clip = *allocation;
   GtkAllocation child_clip;
   gint i;
 
-  priv->text_baseline = gtk_widget_get_allocated_baseline (widget);
-
+  priv->text_baseline = baseline;
   priv->text_x = 0;
   priv->text_width = allocation->width;
 
@@ -3150,9 +3152,8 @@ gtk_entry_size_allocate (GtkWidget     *widget,
       icon_alloc.height = height;
       priv->text_width -= width;
 
-      gtk_widget_size_allocate (icon_info->widget, &icon_alloc);
-      gtk_widget_get_clip (icon_info->widget, &child_clip);
-      gdk_rectangle_union (&child_clip, &clip, &clip);
+      gtk_widget_size_allocate (icon_info->widget, &icon_alloc, baseline, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
     }
 
   if (priv->progress_widget && gtk_widget_get_visible (priv->progress_widget))
@@ -3164,10 +3165,8 @@ gtk_entry_size_allocate (GtkWidget     *widget,
       progress_alloc.width = allocation->width;
       progress_alloc.height = allocation->height;
 
-      gtk_widget_size_allocate (priv->progress_widget, &progress_alloc);
-      gtk_widget_get_clip (priv->progress_widget, &child_clip);
-
-      gdk_rectangle_union (&child_clip, &clip, &clip);
+      gtk_widget_size_allocate (priv->progress_widget, &progress_alloc, -1, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
     }
 
   /* Do this here instead of gtk_entry_size_allocate() so it works
@@ -3183,8 +3182,6 @@ gtk_entry_size_allocate (GtkWidget     *widget,
       if (completion)
         _gtk_entry_completion_resize_popup (completion);
     }
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 static void
index 42a2cab888c6ec3997a91a79a7b9c00114e89d3d..ae1b5332c48fda8e1e7f3fd36336396fbb629a2c 100644 (file)
@@ -60,8 +60,10 @@ static void     gtk_event_box_realize       (GtkWidget        *widget);
 static void     gtk_event_box_unrealize     (GtkWidget        *widget);
 static void     gtk_event_box_map           (GtkWidget        *widget);
 static void     gtk_event_box_unmap         (GtkWidget        *widget);
-static void     gtk_event_box_size_allocate (GtkWidget        *widget,
-                                             GtkAllocation    *allocation);
+static void     gtk_event_box_size_allocate (GtkWidget           *widget,
+                                             const GtkAllocation *allocation,
+                                             int                  baseline,
+                                             GtkAllocation       *out_clip);
 static void     gtk_event_box_set_property  (GObject          *object,
                                              guint             prop_id,
                                              const GValue     *value,
@@ -428,12 +430,13 @@ gtk_event_box_unmap (GtkWidget *widget)
 }
 
 static void
-gtk_event_box_size_allocate (GtkWidget     *widget,
-                             GtkAllocation *allocation)
+gtk_event_box_size_allocate (GtkWidget           *widget,
+                             const GtkAllocation *allocation,
+                             int                  baseline,
+                             GtkAllocation       *out_clip)
 {
   GtkBin *bin;
   GtkAllocation child_allocation;
-  gint baseline;
   GtkEventBoxPrivate *priv;
   GtkWidget *child;
 
@@ -464,8 +467,7 @@ gtk_event_box_size_allocate (GtkWidget     *widget,
                                 child_allocation.height);
     }
 
-  baseline = gtk_widget_get_allocated_baseline (widget);
   child = gtk_bin_get_child (bin);
   if (child)
-    gtk_widget_size_allocate_with_baseline (child, &child_allocation, baseline);
+    gtk_widget_size_allocate (child, &child_allocation, baseline, out_clip);
 }
index 12f81914303caa796d54e0f561503650234a9cca..e1f361760b1bdd3110d831d15c8f28e03673a6fa 100644 (file)
@@ -170,8 +170,10 @@ static void gtk_expander_get_property (GObject          *object,
                                        GParamSpec       *pspec);
 
 static void     gtk_expander_destroy        (GtkWidget        *widget);
-static void     gtk_expander_size_allocate  (GtkWidget        *widget,
-                                             GtkAllocation    *allocation);
+static void     gtk_expander_size_allocate  (GtkWidget           *widget,
+                                             const GtkAllocation *allocation,
+                                             int                  baseline,
+                                             GtkAllocation       *out_clip);
 static gboolean gtk_expander_enter_notify   (GtkWidget        *widget,
                                              GdkEventCrossing *event);
 static gboolean gtk_expander_leave_notify   (GtkWidget        *widget,
@@ -525,16 +527,13 @@ gtk_expander_destroy (GtkWidget *widget)
 }
 
 static void
-gtk_expander_size_allocate (GtkWidget     *widget,
-                            GtkAllocation *allocation)
+gtk_expander_size_allocate (GtkWidget           *widget,
+                            const GtkAllocation *allocation,
+                            int                  baseline,
+                            GtkAllocation       *out_clip)
 {
   GtkExpanderPrivate *priv = GTK_EXPANDER (widget)->priv;
-  GtkAllocation clip = *allocation;
-
-  gtk_widget_size_allocate_with_baseline (priv->box, allocation,
-                                          gtk_widget_get_allocated_baseline (widget));
-  gtk_widget_get_clip (priv->box, &clip);
-  gtk_widget_set_clip (widget, &clip);
+  gtk_widget_size_allocate (priv->box, allocation, baseline, out_clip);
 }
 
 static void
index 18fdde973ce12cec1a74ad9fc4fd4bc3c010518a..48d13cbf60b3716ae203279178163c45403e0069 100644 (file)
@@ -381,17 +381,15 @@ gtk_file_chooser_button_measure (GtkWidget       *widget,
 }
 
 static void
-gtk_file_chooser_button_size_allocate (GtkWidget     *widget,
-                                       GtkAllocation *allocation)
+gtk_file_chooser_button_size_allocate (GtkWidget           *widget,
+                                       const GtkAllocation *allocation,
+                                       int                  baseline,
+                                       GtkAllocation       *out_clip)
 {
   GtkFileChooserButton *button = GTK_FILE_CHOOSER_BUTTON (widget);
   GtkFileChooserButtonPrivate *priv = gtk_file_chooser_button_get_instance_private (button);
-  GtkAllocation clip = *allocation;
 
-  gtk_widget_size_allocate (priv->child, allocation);
-  gtk_widget_get_clip (priv->child, &clip);
-
-  gtk_widget_set_clip (widget, &clip);
+  gtk_widget_size_allocate (priv->child, allocation, baseline, out_clip);
 }
 
 static void
index 833738edf82d33dd116d1f73ad8583baf79aab99..57bef49ffcf867a13ab14d59a353a9ccf9caf9f4 100644 (file)
@@ -231,7 +231,9 @@ static void     gtk_file_chooser_dialog_notify       (GObject               *obj
 static void     gtk_file_chooser_dialog_map          (GtkWidget             *widget);
 static void     gtk_file_chooser_dialog_unmap        (GtkWidget             *widget);
 static void     gtk_file_chooser_dialog_size_allocate (GtkWidget             *widget,
-                                                       GtkAllocation         *allocation);
+                                                       const GtkAllocation   *allocation,
+                                                       int                    baseline,
+                                                       GtkAllocation         *out_clip);
 static void     file_chooser_widget_file_activated   (GtkFileChooser        *chooser,
                                                       GtkFileChooserDialog  *dialog);
 static void     file_chooser_widget_default_size_changed (GtkWidget            *widget,
@@ -616,11 +618,15 @@ gtk_file_chooser_dialog_unmap (GtkWidget *widget)
 }
 
 static void
-gtk_file_chooser_dialog_size_allocate (GtkWidget     *widget,
-                                       GtkAllocation *allocation)
+gtk_file_chooser_dialog_size_allocate (GtkWidget           *widget,
+                                       const GtkAllocation *allocation,
+                                       int                  baseline,
+                                       GtkAllocation       *out_clip)
 {
-  GTK_WIDGET_CLASS (gtk_file_chooser_dialog_parent_class)->size_allocate (widget, allocation);
-
+  GTK_WIDGET_CLASS (gtk_file_chooser_dialog_parent_class)->size_allocate (widget,
+                                                                          allocation,
+                                                                          baseline,
+                                                                          out_clip);
   if (gtk_widget_is_drawable (widget))
     save_dialog_geometry (GTK_FILE_CHOOSER_DIALOG (widget));
 }
index 49fd731181bddf2ac1f8e01c842c12e060f322a3..c31e52e5d0926629444fe5c8936833926ff0702b 100644 (file)
@@ -8062,15 +8062,20 @@ gtk_file_chooser_widget_snapshot (GtkWidget   *widget,
 }
 
 static void
-gtk_file_chooser_widget_size_allocate (GtkWidget     *widget,
-                                       GtkAllocation *allocation)
+gtk_file_chooser_widget_size_allocate (GtkWidget           *widget,
+                                       const GtkAllocation *allocation,
+                                       int                  baseline,
+                                       GtkAllocation       *out_clip)
 {
   GtkFileChooserWidget *self = GTK_FILE_CHOOSER_WIDGET (widget);
   GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (self);
 
-  GTK_WIDGET_CLASS (gtk_file_chooser_widget_parent_class)->size_allocate (widget, allocation);
+  GTK_WIDGET_CLASS (gtk_file_chooser_widget_parent_class)->size_allocate (widget,
+                                                                          allocation,
+                                                                          baseline,
+                                                                          out_clip);
 
-  gtk_widget_size_allocate (priv->box, allocation);
+  gtk_widget_size_allocate (priv->box, allocation, -1, out_clip);
 }
 
 static void
index 4716dd6f0b0a327000a224e2510492a9b72a103b..a4be439fb654d5a69d18ed72a8372ad08c6656f3 100644 (file)
@@ -96,8 +96,10 @@ static void gtk_fixed_measure (GtkWidget      *widget,
                                int            *natural_baseline);
 
 
-static void gtk_fixed_size_allocate (GtkWidget        *widget,
-                                     GtkAllocation    *allocation);
+static void gtk_fixed_size_allocate (GtkWidget           *widget,
+                                     const GtkAllocation *allocation,
+                                     int                  baseline,
+                                     GtkAllocation       *out_clip);
 static void gtk_fixed_snapshot      (GtkWidget        *widget,
                                      GtkSnapshot      *snapshot);
 static void gtk_fixed_add           (GtkContainer     *container,
@@ -385,8 +387,10 @@ gtk_fixed_measure (GtkWidget      *widget,
 }
 
 static void
-gtk_fixed_size_allocate (GtkWidget     *widget,
-                         GtkAllocation *allocation)
+gtk_fixed_size_allocate (GtkWidget           *widget,
+                         const GtkAllocation *allocation,
+                         int                  baseline,
+                         GtkAllocation       *out_clip)
 {
   GtkFixed *fixed = GTK_FIXED (widget);
   GtkFixedPrivate *priv = fixed->priv;
@@ -408,7 +412,7 @@ gtk_fixed_size_allocate (GtkWidget     *widget,
 
       child_allocation.width = child_requisition.width;
       child_allocation.height = child_requisition.height;
-      gtk_widget_size_allocate (child->widget, &child_allocation);
+      gtk_widget_size_allocate (child->widget, &child_allocation, -1, out_clip);
     }
 }
 
index 1fec4ce7a54d59484c8db3081bd66b94f9137a42..6a26d3570c6ea7cd3e461095dee249ebf9abb9f5 100644 (file)
@@ -417,24 +417,16 @@ gtk_flow_box_child_measure (GtkWidget     *widget,
 }
 
 static void
-gtk_flow_box_child_size_allocate (GtkWidget     *widget,
-                                  GtkAllocation *allocation)
+gtk_flow_box_child_size_allocate (GtkWidget           *widget,
+                                  const GtkAllocation *allocation,
+                                  int                  baseline,
+                                  GtkAllocation       *out_clip)
 {
-  GtkAllocation clip = *allocation;
   GtkWidget *child;
 
   child = gtk_bin_get_child (GTK_BIN (widget));
   if (child && gtk_widget_get_visible (child))
-    {
-      GdkRectangle child_clip;
-
-      gtk_widget_size_allocate (child, allocation);
-      gtk_widget_get_clip (child, &child_clip);
-
-      gdk_rectangle_union (&child_clip, &clip, &clip);
-    }
-
-  gtk_widget_set_clip (widget, &clip);
+    gtk_widget_size_allocate (child, allocation, -1, out_clip);
 }
 
 /* GObject implementation {{{2 */
@@ -1402,12 +1394,13 @@ get_offset_pixels (GtkAlign align,
 }
 
 static void
-gtk_flow_box_size_allocate (GtkWidget     *widget,
-                            GtkAllocation *allocation)
+gtk_flow_box_size_allocate (GtkWidget           *widget,
+                            const GtkAllocation *allocation,
+                            int                  baseline,
+                            GtkAllocation       *out_clip)
 {
   GtkFlowBox *box = GTK_FLOW_BOX (widget);
   GtkFlowBoxPrivate  *priv = BOX_PRIV (box);
-  GtkAllocation clip = *allocation;
   GdkRectangle child_clip;
   GtkAllocation widget_allocation;
   GtkAllocation child_allocation;
@@ -1748,9 +1741,8 @@ gtk_flow_box_size_allocate (GtkWidget     *widget,
       if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
         child_allocation.x = allocation->width - child_allocation.x - child_allocation.width;
 
-      gtk_widget_size_allocate (child, &child_allocation);
-      gtk_widget_get_clip (child, &child_clip);
-      gdk_rectangle_union (&clip, &child_clip, &clip);
+      gtk_widget_size_allocate (child, &child_allocation, -1, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
 
       item_offset += this_item_size;
       item_offset += item_spacing;
@@ -1760,8 +1752,6 @@ gtk_flow_box_size_allocate (GtkWidget     *widget,
 
   g_free (item_sizes);
   g_free (line_sizes);
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 static GtkSizeRequestMode
index 4f06b92d94a2c5fa1c4565b958db3fcd06dae7fa..ada22588b038fd48a0246129385dd5305f7db834 100644 (file)
@@ -463,17 +463,15 @@ gtk_font_button_measure (GtkWidget       *widget,
 }
 
 static void
-gtk_font_button_size_allocate (GtkWidget     *widget,
-                               GtkAllocation *allocation)
+gtk_font_button_size_allocate (GtkWidget           *widget,
+                               const GtkAllocation *allocation,
+                               int                  baseline,
+                               GtkAllocation       *out_clip)
 {
   GtkFontButton *button = GTK_FONT_BUTTON (widget);
   GtkFontButtonPrivate *priv = gtk_font_button_get_instance_private (button);
-  GtkAllocation clip = *allocation;
 
-  gtk_widget_size_allocate (priv->button, allocation);
-  gtk_widget_get_clip (priv->button, &clip);
-
-  gtk_widget_set_clip (widget, &clip);
+  gtk_widget_size_allocate (priv->button, allocation, baseline, out_clip);
 }
 
 static void
index 3979872c45ab4c066b8ceeb01098da893894357c..2777579e15a423c9e6568f9b6b726d50fc5fde1d 100644 (file)
@@ -593,15 +593,17 @@ gtk_font_chooser_widget_snapshot (GtkWidget   *widget,
 }
 
 static void
-gtk_font_chooser_widget_size_allocate (GtkWidget     *widget,
-                                       GtkAllocation *allocation)
+gtk_font_chooser_widget_size_allocate (GtkWidget           *widget,
+                                       const GtkAllocation *allocation,
+                                       int                  baseline,
+                                       GtkAllocation       *out_clip)
 {
   GtkFontChooserWidget *self = GTK_FONT_CHOOSER_WIDGET (widget);
   GtkFontChooserWidgetPrivate *priv = gtk_font_chooser_widget_get_instance_private (self);
 
-  GTK_WIDGET_CLASS (gtk_font_chooser_widget_parent_class)->size_allocate (widget, allocation);
+  GTK_WIDGET_CLASS (gtk_font_chooser_widget_parent_class)->size_allocate (widget, allocation, -1, out_clip);
 
-  gtk_widget_size_allocate (priv->grid, allocation);
+  gtk_widget_size_allocate (priv->grid, allocation, -1, out_clip);
 }
 
 static void
index ff59bac030750571790f4622cd25656b42928f6d..2bfa6cf67cd21afc00fdae22d09c42632551ec22 100644 (file)
@@ -117,8 +117,10 @@ static void gtk_frame_get_property (GObject     *object,
                                    guint        param_id,
                                    GValue      *value,
                                    GParamSpec  *pspec);
-static void gtk_frame_size_allocate (GtkWidget      *widget,
-                                    GtkAllocation  *allocation);
+static void gtk_frame_size_allocate (GtkWidget           *widget,
+                                     const GtkAllocation *allocation,
+                                     int                  baseline,
+                                     GtkAllocation       *out_clip);
 static void gtk_frame_remove        (GtkContainer   *container,
                                     GtkWidget      *child);
 static void gtk_frame_forall        (GtkContainer   *container,
@@ -611,15 +613,16 @@ gtk_frame_get_shadow_type (GtkFrame *frame)
 }
 
 static void
-gtk_frame_size_allocate (GtkWidget     *widget,
-                         GtkAllocation *allocation)
+gtk_frame_size_allocate (GtkWidget           *widget,
+                         const GtkAllocation *allocation,
+                         int                  baseline,
+                         GtkAllocation       *out_clip)
 {
   GtkFrame *frame = GTK_FRAME (widget);
   GtkFramePrivate *priv = frame->priv;
   GtkWidget *child;
   GtkAllocation new_allocation;
-  GtkAllocation clip = *allocation;
-  GtkAllocation child_clip = *allocation;
+  GtkAllocation child_clip;
 
   gtk_frame_compute_child_allocation (frame, &new_allocation);
   priv->child_allocation = new_allocation;
@@ -646,20 +649,16 @@ gtk_frame_size_allocate (GtkWidget     *widget,
       priv->label_allocation.height = height;
       priv->label_allocation.width = width;
 
-      gtk_widget_size_allocate (priv->label_widget, &priv->label_allocation);
-      gtk_widget_get_clip (priv->label_widget, &child_clip);
-      gdk_rectangle_union (&child_clip, &clip, &clip);
+      gtk_widget_size_allocate (priv->label_widget, &priv->label_allocation, -1, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
     }
 
   child = gtk_bin_get_child (GTK_BIN (widget));
   if (child && gtk_widget_get_visible (child))
     {
-      gtk_widget_size_allocate (child, &priv->child_allocation);
-      gtk_widget_get_clip (child, &child_clip);
-      gdk_rectangle_union (&child_clip, &clip, &clip);
+      gtk_widget_size_allocate (child, &priv->child_allocation, -1, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
     }
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 static void
index f80fabe3eec60cd745436317a3aacfc0a926eff0..69544c7abbcc7197a305e179ca7adaeff32d1172 100644 (file)
@@ -23,19 +23,18 @@ gtk_gizmo_measure (GtkWidget      *widget,
 }
 
 static void
-gtk_gizmo_size_allocate (GtkWidget     *widget,
-                         GtkAllocation *allocation)
+gtk_gizmo_size_allocate (GtkWidget           *widget,
+                         const GtkAllocation *allocation,
+                         int                  baseline,
+                         GtkAllocation       *out_clip)
 {
   GtkGizmo *self = GTK_GIZMO (widget);
-  GtkAllocation clip = *allocation;
 
   if (self->allocate_func)
     self->allocate_func (self,
                          allocation,
-                         gtk_widget_get_allocated_baseline (widget),
-                         &clip);
-
-  gtk_widget_set_clip (widget, &clip);
+                         baseline,
+                         out_clip);
 }
 
 static void
index 9b9c0217aea3eaaeb4c8e208f23cd319f3b4cfe9..c3135187ef34af980d80656bb79bf7f3e479ac4f 100644 (file)
@@ -576,13 +576,15 @@ gtk_gl_area_unrealize (GtkWidget *widget)
 }
 
 static void
-gtk_gl_area_size_allocate (GtkWidget     *widget,
-                           GtkAllocation *allocation)
+gtk_gl_area_size_allocate (GtkWidget           *widget,
+                           const GtkAllocation *allocation,
+                           int                  baseline,
+                           GtkAllocation       *out_clip)
 {
   GtkGLArea *area = GTK_GL_AREA (widget);
   GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
 
-  GTK_WIDGET_CLASS (gtk_gl_area_parent_class)->size_allocate (widget, allocation);
+  GTK_WIDGET_CLASS (gtk_gl_area_parent_class)->size_allocate (widget, allocation, baseline, out_clip);
 
   if (gtk_widget_get_realized (widget))
     priv->needs_resize = TRUE;
index 937f3bb4ff310fc75b87c486b0cb6368959f5fcb..fbd7814a51721accca4c81af73dbdf1907c20c09 100644 (file)
@@ -1575,20 +1575,19 @@ gtk_grid_request_allocate_children (GtkGridRequest      *request,
         child_allocation.x = allocation->x + allocation->width
                              - (child_allocation.x - allocation->x) - child_allocation.width;
 
-      gtk_widget_size_allocate_with_baseline (child->widget, &child_allocation, baseline);
-      gtk_widget_get_clip (child->widget, &child_clip);
-      gdk_rectangle_union (&child_clip, out_clip, out_clip);
+      gtk_widget_size_allocate (child->widget, &child_allocation, baseline, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
     }
 }
 
 #define GET_SIZE(allocation, orientation) (orientation == GTK_ORIENTATION_HORIZONTAL ? allocation->width : allocation->height)
 
 static void
-gtk_grid_size_allocate (GtkWidget     *widget,
-                        GtkAllocation *allocation)
+gtk_grid_size_allocate (GtkWidget          *widget,
+                        const GtkAllocation *allocation,
+                        int                  baseline,
+                        GtkAllocation       *out_clip)
 {
-  GtkAllocation clip = *allocation;
-  GtkAllocation children_clip = *allocation;
   GtkGrid *grid = GTK_GRID (widget);
   GtkGridPrivate *priv = grid->priv;
   GtkGridRequest request;
@@ -1596,10 +1595,7 @@ gtk_grid_size_allocate (GtkWidget     *widget,
   GtkOrientation orientation;
 
   if (priv->children == NULL)
-    {
-      gtk_widget_set_clip (widget, &clip);
-      return;
-    }
+    return;
 
   request.grid = grid;
 
@@ -1625,10 +1621,7 @@ gtk_grid_size_allocate (GtkWidget     *widget,
   gtk_grid_request_position (&request, 0);
   gtk_grid_request_position (&request, 1);
 
-  gtk_grid_request_allocate_children (&request, allocation, &children_clip);
-  gdk_rectangle_union (&children_clip, &clip, &clip);
-
-  gtk_widget_set_clip (widget, &clip);
+  gtk_grid_request_allocate_children (&request, allocation, out_clip);
 }
 
 static void
index e415a4c2f1ab9cb9dd13e0f70d26763a6b5f7928..c5d440139e296565de2d1c575a6d608bb5aa4c6c 100644 (file)
@@ -893,11 +893,12 @@ gtk_header_bar_measure (GtkWidget      *widget,
 }
 
 static void
-gtk_header_bar_size_allocate (GtkWidget     *widget,
-                              GtkAllocation *allocation)
+gtk_header_bar_size_allocate (GtkWidget           *widget,
+                              const GtkAllocation *allocation,
+                              int                  baseline,
+                              GtkAllocation       *out_clip)
 {
   GtkHeaderBarPrivate *priv = gtk_header_bar_get_instance_private (GTK_HEADER_BAR (widget));
-  GtkAllocation clip = *allocation;
   GtkWidget *title_widget;
   GtkHeaderBar *bar = GTK_HEADER_BAR (widget);
   GtkRequestedSize *sizes;
@@ -919,7 +920,7 @@ gtk_header_bar_size_allocate (GtkWidget     *widget,
   gint x;
   gint child_size;
   GtkTextDirection direction;
-  GtkAllocation child_clip;
+  GtkAllocation child_clip = {0, };
 
   direction = gtk_widget_get_direction (widget);
   nvis_children = count_visible_children (bar);
@@ -1096,9 +1097,8 @@ gtk_header_bar_size_allocate (GtkWidget     *widget,
           if (direction == GTK_TEXT_DIR_RTL)
             child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width;
 
-          gtk_widget_size_allocate (child->widget, &child_allocation);
-          gtk_widget_get_clip (child->widget, &child_clip);
-          gdk_rectangle_union (&child_clip, &clip, &clip);
+          gtk_widget_size_allocate (child->widget, &child_allocation, baseline, &child_clip);
+          gdk_rectangle_union (out_clip, &child_clip, out_clip);
 
         next:
           i++;
@@ -1135,9 +1135,8 @@ gtk_header_bar_size_allocate (GtkWidget     *widget,
 
   if (title_widget != NULL)
     {
-      gtk_widget_size_allocate (title_widget, &child_allocation);
-      gtk_widget_get_clip (title_widget, &child_clip);
-      gdk_rectangle_union (&child_clip, &clip, &clip);
+      gtk_widget_size_allocate (title_widget, &child_allocation, baseline, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
     }
 
   child_allocation.y = allocation->y;
@@ -1151,9 +1150,8 @@ gtk_header_bar_size_allocate (GtkWidget     *widget,
       else
         child_allocation.x = allocation->x + allocation->width - start_width + priv->spacing;
       child_allocation.width = start_width - priv->spacing;
-      gtk_widget_size_allocate (priv->titlebar_start_box, &child_allocation);
-      gtk_widget_get_clip (priv->titlebar_start_box, &child_clip);
-      gdk_rectangle_union (&child_clip, &clip, &clip);
+      gtk_widget_size_allocate (priv->titlebar_start_box, &child_allocation, baseline, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
     }
 
   if (priv->titlebar_end_box)
@@ -1164,12 +1162,9 @@ gtk_header_bar_size_allocate (GtkWidget     *widget,
       else
         child_allocation.x = allocation->x + allocation->width - end_width + priv->spacing;
       child_allocation.width = end_width - priv->spacing;
-      gtk_widget_size_allocate (priv->titlebar_end_box, &child_allocation);
-      gtk_widget_get_clip (priv->titlebar_end_box, &child_clip);
-      gdk_rectangle_union (&child_clip, &clip, &clip);
+      gtk_widget_size_allocate (priv->titlebar_end_box, &child_allocation, baseline, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
     }
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 /**
index 56b4fdd52c3573931daf762310b4c6bd1dec0866..aefd1c7f8a9bdca628bbf9bba2178e3f1631fe29 100644 (file)
 
 G_DEFINE_TYPE (GtkIcon, gtk_icon, GTK_TYPE_WIDGET)
 
-static void
-gtk_icon_size_allocate (GtkWidget     *widget,
-                        GtkAllocation *allocation)
-{
-  gtk_widget_set_clip (widget, allocation);
-}
-
 static void
 gtk_icon_snapshot (GtkWidget   *widget,
                    GtkSnapshot *snapshot)
@@ -61,7 +54,6 @@ gtk_icon_class_init (GtkIconClass *klass)
 {
   GtkWidgetClass *wclass = GTK_WIDGET_CLASS (klass);
 
-  wclass->size_allocate = gtk_icon_size_allocate;
   wclass->snapshot = gtk_icon_snapshot;
 }
 
index cf06fb1ae79b08ee8e46863825423ef39b1d8f28..c7ae2a3f4e32596a02020c873a07567a7cc86abd 100644 (file)
@@ -150,8 +150,10 @@ static void gtk_icon_view_measure (GtkWidget *widget,
                                    int            *natural,
                                    int            *minimum_baseline,
                                    int            *natural_baseline);
-static void             gtk_icon_view_size_allocate             (GtkWidget          *widget,
-                                                                GtkAllocation      *allocation);
+static void             gtk_icon_view_size_allocate             (GtkWidget           *widget,
+                                                                 const GtkAllocation *allocation,
+                                                                 int                  baseline,
+                                                                 GtkAllocation       *out_clip);
 static void             gtk_icon_view_snapshot                  (GtkWidget          *widget,
                                                                  GtkSnapshot        *snapshot);
 static gboolean         gtk_icon_view_motion                    (GtkWidget          *widget,
@@ -1604,15 +1606,18 @@ gtk_icon_view_allocate_children (GtkIconView *icon_view)
   for (list = icon_view->priv->children; list; list = list->next)
     {
       GtkIconViewChild *child = list->data;
+      GtkAllocation clip;
 
       /* totally ignore our child's requisition */
-      gtk_widget_size_allocate (child->widget, &child->area);
+      gtk_widget_size_allocate (child->widget, &child->area, -1, &clip);
     }
 }
 
 static void
-gtk_icon_view_size_allocate (GtkWidget      *widget,
-                            GtkAllocation  *allocation)
+gtk_icon_view_size_allocate (GtkWidget           *widget,
+                             const GtkAllocation *allocation,
+                             int                  baseline,
+                             GtkAllocation       *out_clip)
 {
   GtkIconView *icon_view = GTK_ICON_VIEW (widget);
 
@@ -1645,8 +1650,6 @@ gtk_icon_view_size_allocate (GtkWidget      *widget,
   /* Emit any pending signals now */
   g_object_thaw_notify (G_OBJECT (icon_view->priv->hadjustment));
   g_object_thaw_notify (G_OBJECT (icon_view->priv->vadjustment));
-
-  gtk_widget_set_clip (widget, allocation);
 }
 
 static void
index 2e3663d7e842f50799d19afca345d8bbb598fc38..bb0cb6189ce33e6ecc1681425dc19911c8b98186 100644 (file)
@@ -141,8 +141,10 @@ struct _GtkImagePrivate
 #define DEFAULT_ICON_SIZE GTK_ICON_SIZE_BUTTON
 static void gtk_image_snapshot             (GtkWidget    *widget,
                                             GtkSnapshot  *snapshot);
-static void gtk_image_size_allocate        (GtkWidget    *widget,
-                                            GtkAllocation*allocation);
+static void gtk_image_size_allocate        (GtkWidget           *widget,
+                                            const GtkAllocation *allocation,
+                                            int                  baseline,
+                                            GtkAllocation       *out_clip);
 static void gtk_image_unmap                (GtkWidget    *widget);
 static void gtk_image_unrealize            (GtkWidget    *widget);
 static void gtk_image_measure (GtkWidget      *widget,
@@ -1271,22 +1273,17 @@ gtk_image_reset_anim_iter (GtkImage *image)
 }
 
 static void
-gtk_image_size_allocate (GtkWidget     *widget,
-                         GtkAllocation *allocation)
+gtk_image_size_allocate (GtkWidget           *widget,
+                         const GtkAllocation *allocation,
+                         int                  baseline,
+                         GtkAllocation       *out_clip)
 {
-  GtkAllocation clip = *allocation;
-  GdkRectangle extents;
-
   _gtk_style_context_get_icon_extents (gtk_widget_get_style_context (widget),
-                                       &extents,
+                                       out_clip,
                                        allocation->x,
                                        allocation->y,
                                        allocation->width,
                                        allocation->height);
-
-  gdk_rectangle_union (&clip, &extents, &clip);
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 static void
index 9478977d4f4772026a4ad73b5885b877425c8ad5..2ead4898786556f690dfc7d789ee15e26feb7b1d 100644 (file)
@@ -59,8 +59,6 @@ static void gtk_invisible_destroy       (GtkWidget         *widget);
 static void gtk_invisible_realize       (GtkWidget         *widget);
 static void gtk_invisible_style_updated (GtkWidget         *widget);
 static void gtk_invisible_show          (GtkWidget         *widget);
-static void gtk_invisible_size_allocate (GtkWidget         *widget,
-                                        GtkAllocation     *allocation);
 static void gtk_invisible_set_property  (GObject           *object,
                                         guint              prop_id,
                                         const GValue      *value,
@@ -85,7 +83,6 @@ gtk_invisible_class_init (GtkInvisibleClass *class)
   widget_class->realize = gtk_invisible_realize;
   widget_class->style_updated = gtk_invisible_style_updated;
   widget_class->show = gtk_invisible_show;
-  widget_class->size_allocate = gtk_invisible_size_allocate;
   widget_class->destroy = gtk_invisible_destroy;
 
   gobject_class->set_property = gtk_invisible_set_property;
@@ -251,14 +248,6 @@ gtk_invisible_show (GtkWidget *widget)
   gtk_widget_map (widget);
 }
 
-static void
-gtk_invisible_size_allocate (GtkWidget     *widget,
-                             GtkAllocation *allocation)
-{
-  gtk_widget_set_clip (widget, allocation);
-}
-
-
 static void 
 gtk_invisible_set_property  (GObject      *object,
                             guint         prop_id,
index 5b5525f0fa1a3ca266213beb564a1bb10ae81bde..ab8ce366736a632e37e5c082b292346e28b62e12 100644 (file)
@@ -398,8 +398,10 @@ static void gtk_label_get_property      (GObject          *object,
                                         GParamSpec       *pspec);
 static void gtk_label_finalize          (GObject          *object);
 static void gtk_label_destroy           (GtkWidget        *widget);
-static void gtk_label_size_allocate     (GtkWidget        *widget,
-                                         GtkAllocation    *allocation);
+static void gtk_label_size_allocate     (GtkWidget           *widget,
+                                         const GtkAllocation *allocation,
+                                         int                  baseline,
+                                         GtkAllocation       *out_clip);
 static void gtk_label_state_flags_changed   (GtkWidget        *widget,
                                              GtkStateFlags     prev_state);
 static void gtk_label_style_updated     (GtkWidget        *widget);
@@ -3722,19 +3724,18 @@ gtk_label_get_ink_rect (GtkLabel     *label,
 }
 
 static void
-gtk_label_size_allocate (GtkWidget     *widget,
-                         GtkAllocation *allocation)
+gtk_label_size_allocate (GtkWidget           *widget,
+                         const GtkAllocation *allocation,
+                         int                  baseline,
+                         GtkAllocation       *out_clip)
 {
   GtkLabel *label = GTK_LABEL (widget);
   GtkLabelPrivate *priv = label->priv;
-  GdkRectangle clip_rect;
 
   if (priv->layout)
     gtk_label_update_layout_width (label);
 
-  gtk_label_get_ink_rect (label, &clip_rect);
-  gdk_rectangle_union (&clip_rect, allocation, &clip_rect);
-  gtk_widget_set_clip (widget, &clip_rect);
+  gtk_label_get_ink_rect (label, out_clip);
 }
 
 static void
index c51093469f73b6dc96844edc65e5716e4e7d300a..c4e46ae49379fcb3e8b34f0b2473b38b5885e01e 100644 (file)
@@ -122,8 +122,10 @@ static void gtk_layout_measure (GtkWidget *widget,
                                 int            *natural,
                                 int            *minimum_baseline,
                                 int            *natural_baseline);
-static void gtk_layout_size_allocate      (GtkWidget      *widget,
-                                           GtkAllocation  *allocation);
+static void gtk_layout_size_allocate      (GtkWidget          *widget,
+                                           const GtkAllocation *allocation,
+                                           int                 baseline,
+                                           GtkAllocation      *out_clip);
 static void gtk_layout_add                (GtkContainer   *container,
                                           GtkWidget      *widget);
 static void gtk_layout_remove             (GtkContainer   *container,
@@ -757,8 +759,10 @@ gtk_layout_measure (GtkWidget *widget,
 
 
 static void
-gtk_layout_size_allocate (GtkWidget     *widget,
-                         GtkAllocation *allocation)
+gtk_layout_size_allocate (GtkWidget           *widget,
+                          const GtkAllocation *allocation,
+                          int                  baseline,
+                          GtkAllocation       *out_clip)
 {
   GtkLayout *layout = GTK_LAYOUT (widget);
   GtkLayoutPrivate *priv = layout->priv;
@@ -776,8 +780,6 @@ gtk_layout_size_allocate (GtkWidget     *widget,
 
   gtk_layout_set_hadjustment_values (layout);
   gtk_layout_set_vadjustment_values (layout);
-
-  gtk_widget_set_clip (widget, allocation);
 }
 
 /* Container methods
@@ -846,6 +848,7 @@ gtk_layout_allocate_child (GtkLayout      *layout,
 {
   GtkAllocation allocation;
   GtkRequisition requisition;
+  GtkAllocation child_clip;
 
   allocation.x = child->x;
   allocation.y = child->y;
@@ -853,8 +856,8 @@ gtk_layout_allocate_child (GtkLayout      *layout,
   gtk_widget_get_preferred_size (child->widget, &requisition, NULL);
   allocation.width = requisition.width;
   allocation.height = requisition.height;
-  
-  gtk_widget_size_allocate (child->widget, &allocation);
+
+  gtk_widget_size_allocate (child->widget, &allocation, -1, &child_clip);
 }
 
 /* Callbacks */
index 969fe47e4bf7280a469cf3dc1f44507d67cc4007..523b1f37905fc0d40f45a0b6e5b6ec1dd6631046 100644 (file)
@@ -436,10 +436,10 @@ gtk_level_bar_allocate_trough_continuous (GtkLevelBar *self,
 
   /* allocate the empty (unfilled) part */
   block_area = *allocation;
-  gtk_widget_size_allocate_with_baseline (self->priv->block_widget[inverted ? 0 : 1],
-                                          &block_area,
-                                          baseline);
-  gtk_widget_get_clip (self->priv->block_widget[inverted ? 0 : 1], out_clip);
+  gtk_widget_size_allocate (self->priv->block_widget[inverted ? 0 : 1],
+                            &block_area,
+                            baseline,
+                            out_clip);
 
   /* now allocate the filled part */
   block_area = *allocation;
@@ -466,10 +466,10 @@ gtk_level_bar_allocate_trough_continuous (GtkLevelBar *self,
         block_area.y += allocation->height - block_area.height;
     }
 
-  gtk_widget_size_allocate_with_baseline (self->priv->block_widget[inverted ? 1 : 0],
-                                          &block_area,
-                                          baseline);
-  gtk_widget_get_clip (self->priv->block_widget[inverted ? 1 : 0], &clip);
+  gtk_widget_size_allocate (self->priv->block_widget[inverted ? 1 : 0],
+                            &block_area,
+                            baseline,
+                            &clip);
   gdk_rectangle_intersect (out_clip, &clip, out_clip);
 }
 
@@ -507,10 +507,10 @@ gtk_level_bar_allocate_trough_discrete (GtkLevelBar *self,
 
   for (i = 0; i < num_blocks; i++)
     {
-      gtk_widget_size_allocate_with_baseline (self->priv->block_widget[i],
-                                              &block_area,
-                                              baseline);
-      gtk_widget_get_clip (self->priv->block_widget[i], &clip);
+      gtk_widget_size_allocate (self->priv->block_widget[i],
+                                &block_area,
+                                baseline,
+                                &clip);
       gdk_rectangle_intersect (out_clip, &clip, out_clip);
 
       if (self->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
@@ -536,16 +536,14 @@ gtk_level_bar_allocate_trough (GtkGizmo            *gizmo,
 }
 
 static void
-gtk_level_bar_size_allocate (GtkWidget     *widget,
-                             GtkAllocation *allocation)
+gtk_level_bar_size_allocate (GtkWidget           *widget,
+                             const GtkAllocation *allocation,
+                             int                  baseline,
+                             GtkAllocation       *out_clip)
 {
   GtkLevelBarPrivate *priv = gtk_level_bar_get_instance_private (GTK_LEVEL_BAR (widget));
-  GtkAllocation clip = *allocation;
 
-  gtk_widget_size_allocate (priv->trough_widget, allocation);
-  gtk_widget_get_clip (priv->trough_widget, &clip);
-
-  gtk_widget_set_clip (widget, &clip);
+  gtk_widget_size_allocate (priv->trough_widget, allocation, baseline, out_clip);
 }
 
 static void
index 12d76fe3734404e4613e2f5877466720692a24c3..c19e01b6ad228b87ec728c8def62ccd03fb93e60 100644 (file)
@@ -214,7 +214,9 @@ static void                 gtk_list_box_compute_expand               (GtkWidget
 static GType                gtk_list_box_child_type                   (GtkContainer        *container);
 static GtkSizeRequestMode   gtk_list_box_get_request_mode             (GtkWidget           *widget);
 static void                 gtk_list_box_size_allocate                (GtkWidget           *widget,
-                                                                       GtkAllocation       *allocation);
+                                                                       const GtkAllocation *allocation,
+                                                                       int                  baseline,
+                                                                       GtkAllocation       *out_clip);
 static void                 gtk_list_box_drag_leave                   (GtkWidget           *widget,
                                                                        GdkDragContext      *context,
                                                                        guint                time_);
@@ -2509,11 +2511,12 @@ gtk_list_box_measure (GtkWidget     *widget,
 }
 
 static void
-gtk_list_box_size_allocate (GtkWidget     *widget,
-                            GtkAllocation *allocation)
+gtk_list_box_size_allocate (GtkWidget           *widget,
+                            const GtkAllocation *allocation,
+                            int                  baseline,
+                            GtkAllocation       *out_clip)
 {
   GtkListBoxPrivate *priv = BOX_PRIV (widget);
-  GtkAllocation clip = *allocation;
   GtkAllocation child_clip;
   GtkAllocation child_allocation;
   GtkAllocation header_allocation;
@@ -2539,9 +2542,8 @@ gtk_list_box_size_allocate (GtkWidget     *widget,
                           &child_min, NULL, NULL, NULL);
       header_allocation.height = allocation->height;
       header_allocation.y = child_allocation.y;
-      gtk_widget_size_allocate (priv->placeholder, &header_allocation);
-      gtk_widget_get_clip (priv->placeholder, &child_clip);
-      gdk_rectangle_union (&child_clip, &clip, &clip);
+      gtk_widget_size_allocate (priv->placeholder, &header_allocation, -1, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
       child_allocation.y += child_min;
     }
 
@@ -2564,9 +2566,11 @@ gtk_list_box_size_allocate (GtkWidget     *widget,
                               &child_min, NULL, NULL, NULL);
           header_allocation.height = child_min;
           header_allocation.y = child_allocation.y;
-          gtk_widget_size_allocate (ROW_PRIV (row)->header, &header_allocation);
-          gtk_widget_get_clip (ROW_PRIV (row)->header, &child_clip);
-          gdk_rectangle_union (&child_clip, &clip, &clip);
+          gtk_widget_size_allocate (ROW_PRIV (row)->header,
+                                    &header_allocation,
+                                    -1,
+                                    &child_clip);
+          gdk_rectangle_union (out_clip, &child_clip, out_clip);
           child_allocation.y += child_min;
         }
 
@@ -2578,13 +2582,10 @@ gtk_list_box_size_allocate (GtkWidget     *widget,
       child_allocation.height = child_min;
 
       ROW_PRIV (row)->height = child_allocation.height;
-      gtk_widget_size_allocate (GTK_WIDGET (row), &child_allocation);
-      gtk_widget_get_clip (GTK_WIDGET (row), &child_clip);
-      gdk_rectangle_union (&child_clip, &clip, &clip);
+      gtk_widget_size_allocate (GTK_WIDGET (row), &child_allocation, -1, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
       child_allocation.y += child_min;
     }
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 /**
@@ -3061,20 +3062,16 @@ gtk_list_box_row_measure (GtkWidget     *widget,
 }
 
 static void
-gtk_list_box_row_size_allocate (GtkWidget     *widget,
-                                GtkAllocation *allocation)
+gtk_list_box_row_size_allocate (GtkWidget           *widget,
+                                const GtkAllocation *allocation,
+                                int                  baseline,
+                                GtkAllocation       *out_clip)
 {
   GtkWidget *child;
-  GtkAllocation clip = *allocation;
 
   child = gtk_bin_get_child (GTK_BIN (widget));
   if (child && gtk_widget_get_visible (child))
-    {
-      gtk_widget_size_allocate (child, allocation);
-      gtk_widget_get_clip (child, &clip);
-    }
-
-  gtk_widget_set_clip (widget, &clip);
+    gtk_widget_size_allocate (child, allocation, baseline, out_clip);
 }
 
 /**
index 5b3560cd04da17ef786d146c37ff974841249ed1..4827d63f9b81c373473623833c43308707a493b7 100644 (file)
@@ -164,6 +164,8 @@ gtk_magnifier_measure (GtkWidget      *widget,
 static void
 resize_handler (GtkWidget     *widget,
                 GtkAllocation *alloc,
+                int            baseline,
+                GtkAllocation *out_clip,
                 GtkWidget     *magnifier)
 {
   gtk_widget_queue_resize (magnifier);
index 5a66f30ac578c3231051cfaddcd473b1734ae9e6..1ad97d0aa7b36d889deb6d83c6cc74974dc86b34 100644 (file)
@@ -231,8 +231,10 @@ static void     gtk_menu_get_child_property(GtkContainer     *container,
 static void     gtk_menu_destroy           (GtkWidget        *widget);
 static void     gtk_menu_realize           (GtkWidget        *widget);
 static void     gtk_menu_unrealize         (GtkWidget        *widget);
-static void     gtk_menu_size_allocate     (GtkWidget        *widget,
-                                            GtkAllocation    *allocation);
+static void     gtk_menu_size_allocate     (GtkWidget           *widget,
+                                            const GtkAllocation *allocation,
+                                            int                  baseline,
+                                            GtkAllocation       *out_clip);
 static void     gtk_menu_show              (GtkWidget        *widget);
 static void     gtk_menu_snapshot          (GtkWidget        *widget,
                                             GtkSnapshot      *snapshot);
@@ -2691,15 +2693,16 @@ calculate_line_heights (GtkMenu *menu,
 }
 
 static void
-gtk_menu_size_allocate (GtkWidget     *widget,
-                        GtkAllocation *allocation)
+gtk_menu_size_allocate (GtkWidget           *widget,
+                        const GtkAllocation *allocation,
+                        int                  baseline,
+                        GtkAllocation       *out_clip)
 {
   GtkMenu *menu;
   GtkMenuPrivate *priv;
   GtkMenuShell *menu_shell;
   GtkWidget *child;
   GtkAllocation arrow_allocation, child_allocation;
-  GtkAllocation clip = *allocation;
   GList *children;
   gint x, y, i;
   gint width, height;
@@ -2739,13 +2742,13 @@ gtk_menu_size_allocate (GtkWidget     *widget,
   arrow_allocation.height = arrow_border.top;
 
   if (priv->upper_arrow_visible)
-    gtk_widget_size_allocate (priv->top_arrow_widget, &arrow_allocation);
+    gtk_widget_size_allocate (priv->top_arrow_widget, &arrow_allocation, -1, out_clip);
 
   arrow_allocation.y = height - y - arrow_border.bottom;
   arrow_allocation.height = arrow_border.bottom;
 
   if (priv->lower_arrow_visible)
-    gtk_widget_size_allocate (priv->bottom_arrow_widget, &arrow_allocation);
+    gtk_widget_size_allocate (priv->bottom_arrow_widget, &arrow_allocation, -1, out_clip);
 
   width = MAX (1, width);
   height = MAX (1, height);
@@ -2790,12 +2793,10 @@ gtk_menu_size_allocate (GtkWidget     *widget,
               gtk_menu_item_toggle_size_allocate (GTK_MENU_ITEM (child),
                                                   priv->toggle_size);
 
-              gtk_widget_size_allocate (child, &child_allocation);
+              gtk_widget_size_allocate (child, &child_allocation, -1, out_clip);
             }
         }
     }
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 static void
index 955d39a7194800feaf1b31ebb53a612ecef7995e..d18ea69b74e4a78ed3820535426bb53a29b800aa 100644 (file)
@@ -88,8 +88,10 @@ static void gtk_menu_bar_measure (GtkWidget     *widget,
                                   int            *natural,
                                   int            *minimum_baseline,
                                   int            *natural_baseline);
-static void gtk_menu_bar_size_allocate     (GtkWidget       *widget,
-                                           GtkAllocation   *allocation);
+static void gtk_menu_bar_size_allocate     (GtkWidget           *widget,
+                                            const GtkAllocation *allocation,
+                                            int                  baseline,
+                                            GtkAllocation       *out_clip);
 static void gtk_menu_bar_hierarchy_changed (GtkWidget       *widget,
                                            GtkWidget       *old_toplevel);
 static gint gtk_menu_bar_get_popup_delay   (GtkMenuShell    *menu_shell);
@@ -342,12 +344,13 @@ gtk_menu_bar_measure (GtkWidget      *widget,
 }
 
 static void
-gtk_menu_bar_size_allocate (GtkWidget     *widget,
-                            GtkAllocation *allocation)
+gtk_menu_bar_size_allocate (GtkWidget           *widget,
+                            const GtkAllocation *allocation,
+                            int                  baseline,
+                            GtkAllocation       *out_clip)
 {
   GtkMenuBar *menu_bar = GTK_MENU_BAR (widget);
   GtkMenuBarPrivate *priv = menu_bar->priv;
-  GtkAllocation clip = *allocation;
   GtkMenuShell *menu_shell;
   GtkWidget *child;
   GList *children;
@@ -416,7 +419,7 @@ gtk_menu_bar_size_allocate (GtkWidget     *widget,
           else
             child_allocation.x += remaining_space.width;
 
-          gtk_widget_size_allocate (request->data, &child_allocation);
+          gtk_widget_size_allocate (request->data, &child_allocation, -1, out_clip);
         }
     }
   else
@@ -470,13 +473,11 @@ gtk_menu_bar_size_allocate (GtkWidget     *widget,
           else
             child_allocation.y += remaining_space.height;
 
-          gtk_widget_size_allocate (request->data, &child_allocation);
+          gtk_widget_size_allocate (request->data, &child_allocation, -1, out_clip);
         }
     }
 
   g_array_free (requested_sizes, TRUE);
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 static GList *
index ab130da5ad475fa3367adec84367103c7735e478..1dfdef0d4a4290b263b20dcb2fc0a279f5e1416e 100644 (file)
@@ -246,12 +246,13 @@ gtk_menu_item_actionable_interface_init (GtkActionableInterface *iface)
 }
 
 static void
-gtk_menu_item_size_allocate (GtkWidget     *widget,
-                             GtkAllocation *allocation)
+gtk_menu_item_size_allocate (GtkWidget           *widget,
+                             const GtkAllocation *allocation,
+                             int                  baseline,
+                             GtkAllocation       *out_clip)
 {
   GtkMenuItem *menu_item = GTK_MENU_ITEM (widget);
   GtkMenuItemPrivate *priv = menu_item->priv;
-  GtkAllocation clip = *allocation;
   GtkAllocation child_allocation;
   GtkAllocation arrow_clip = { 0 };
   GtkAllocation child_clip = *allocation;
@@ -324,22 +325,18 @@ gtk_menu_item_size_allocate (GtkWidget     *widget,
           arrow_alloc.y = child_allocation.y +
             (child_allocation.height - arrow_alloc.height) / 2;
 
-          gtk_widget_size_allocate (priv->arrow_widget, &arrow_alloc);
-          gtk_widget_get_clip (priv->arrow_widget, &arrow_clip);
-          gdk_rectangle_union (&arrow_clip, &clip, &clip);
-       }
+          gtk_widget_size_allocate(priv->arrow_widget, &arrow_alloc, baseline, &arrow_clip);
+          gdk_rectangle_union (out_clip, &arrow_clip, out_clip);
+        }
 
       child_allocation.width = MAX (1, child_allocation.width);
 
-      gtk_widget_size_allocate (child, &child_allocation);
-      gtk_widget_get_clip (child, &child_clip);
-      gdk_rectangle_union (&child_clip, &clip, &clip);
+      gtk_widget_size_allocate (child, &child_allocation, baseline, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
     }
 
   if (priv->submenu)
     gtk_menu_reposition (GTK_MENU (priv->submenu));
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 static void
index d87f838cdf76fd3e604b1ffa6e14d7c2cdcb081e..9a346a80df46d91071d2cc12a3de0cbdeb3be4cb 100644 (file)
@@ -755,23 +755,26 @@ gtk_model_button_measure (GtkWidget      *widget,
 }
 
 static void
-gtk_model_button_size_allocate (GtkWidget     *widget,
-                                GtkAllocation *allocation)
+gtk_model_button_size_allocate (GtkWidget           *widget,
+                                const GtkAllocation *allocation,
+                                int                  baseline,
+                                GtkAllocation       *out_clip)
 {
   if (GTK_MODEL_BUTTON (widget)->iconic)
     {
-      GTK_WIDGET_CLASS (gtk_model_button_parent_class)->size_allocate (widget, allocation);
+      GTK_WIDGET_CLASS (gtk_model_button_parent_class)->size_allocate (widget,
+                                                                       allocation,
+                                                                       baseline,
+                                                                       out_clip);
     }
   else
     {
-      GtkAllocation clip = *allocation;
       GtkAllocation child_clip = *allocation;
       GtkModelButton *button;
       GtkAllocation child_allocation;
       GtkWidget *child;
       gint check_min_width, check_nat_width;
       gint check_min_height, check_nat_height;
-      int baseline;
 
       button = GTK_MODEL_BUTTON (widget);
       child = gtk_bin_get_child (GTK_BIN (widget));
@@ -797,10 +800,8 @@ gtk_model_button_size_allocate (GtkWidget     *widget,
       child_allocation.width = check_nat_width;
       child_allocation.height = check_nat_height;
 
-      gtk_widget_size_allocate_with_baseline (button->indicator_widget, &child_allocation,
-                                              gtk_widget_get_allocated_baseline (widget));
-      gtk_widget_get_clip (button->indicator_widget, &child_clip);
-      gdk_rectangle_union (&clip, &child_clip, &clip);
+      gtk_widget_size_allocate (button->indicator_widget, &child_allocation, baseline, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
 
       if (child && gtk_widget_get_visible (child))
         {
@@ -824,16 +825,12 @@ gtk_model_button_size_allocate (GtkWidget     *widget,
           child_allocation.width = allocation->width - border.left - border.right;
           child_allocation.height = allocation->height - border.top - border.bottom;
 
-          baseline = gtk_widget_get_allocated_baseline (widget);
           if (baseline != -1)
             baseline -= border.top;
 
-          gtk_widget_size_allocate_with_baseline (child, &child_allocation, baseline);
-          gtk_widget_get_clip (child, &child_clip);
-          gdk_rectangle_union (&clip, &child_clip, &clip);
+          gtk_widget_size_allocate (child, &child_allocation, baseline, &child_clip);
+          gdk_rectangle_union (out_clip, &child_clip, out_clip);
         }
-
-      gtk_widget_set_clip (widget, &clip);
     }
 }
 
index cbfc18a91df25187782c3affb53fd6a5120ee621..bef55bd5a367de2a3b397c6775197759516f072b 100644 (file)
@@ -362,8 +362,10 @@ static void gtk_notebook_measure (GtkWidget      *widget,
                                   int            *natural,
                                   int            *minimum_baseline,
                                   int            *natural_baseline);
-static void gtk_notebook_size_allocate       (GtkWidget        *widget,
-                                              GtkAllocation    *allocation);
+static void gtk_notebook_size_allocate       (GtkWidget           *widget,
+                                              const GtkAllocation *allocation,
+                                              int                  baseline,
+                                              GtkAllocation       *out_clip);
 static void gtk_notebook_snapshot            (GtkWidget        *widget,
                                               GtkSnapshot      *snapshot);
 static gboolean gtk_notebook_popup_menu      (GtkWidget        *widget);
@@ -2071,17 +2073,15 @@ gtk_notebook_allocate_tabs (GtkGizmo            *gizmo,
 }
 
 static void
-gtk_notebook_size_allocate (GtkWidget     *widget,
-                            GtkAllocation *allocation)
+gtk_notebook_size_allocate (GtkWidget           *widget,
+                            const GtkAllocation *allocation,
+                            int                  baseline,
+                            GtkAllocation       *out_clip)
 {
   GtkNotebook *notebook = GTK_NOTEBOOK (widget);
   GtkNotebookPrivate *priv = notebook->priv;
-  GtkAllocation clip = *allocation;
-
-  gtk_widget_size_allocate (priv->box, allocation);
-  gtk_widget_get_clip (priv->box, &clip);
 
-  gtk_widget_set_clip (widget, &clip);
+  gtk_widget_size_allocate (priv->box, allocation, -1, out_clip);
 }
 
 static void
@@ -3959,11 +3959,7 @@ allocate_tab (GtkGizmo            *gizmo,
         }
     }
 
-  gtk_widget_size_allocate_with_baseline (page->tab_label,
-                                          &child_allocation,
-                                          baseline);
-
-  gtk_widget_get_clip (page->tab_label, out_clip);
+  gtk_widget_size_allocate (page->tab_label, &child_allocation, baseline, out_clip);
 }
 
 static gint
@@ -4534,8 +4530,10 @@ gtk_notebook_allocate_arrows (GtkNotebook   *notebook,
             {
               arrow_allocation.x = allocation->x;
               arrow_allocation.width = min;
-              gtk_widget_size_allocate (priv->arrow_widget[ii], &arrow_allocation);
-              gtk_widget_get_clip (priv->arrow_widget[ii], &arrow_clip);
+              gtk_widget_size_allocate (priv->arrow_widget[ii],
+                                        &arrow_allocation,
+                                        -1,
+                                        &arrow_clip);
               allocation->x += min;
               allocation->width -= min;
             }
@@ -4543,8 +4541,10 @@ gtk_notebook_allocate_arrows (GtkNotebook   *notebook,
             {
               arrow_allocation.x = allocation->x + allocation->width - min;
               arrow_allocation.width = min;
-              gtk_widget_size_allocate (priv->arrow_widget[ii], &arrow_allocation);
-              gtk_widget_get_clip (priv->arrow_widget[ii], &arrow_clip);
+              gtk_widget_size_allocate (priv->arrow_widget[ii],
+                                        &arrow_allocation,
+                                        -1,
+                                        &arrow_clip);
               allocation->width -= min;
             }
         }
@@ -4566,11 +4566,11 @@ gtk_notebook_allocate_arrows (GtkNotebook   *notebook,
           arrow_allocation.width = size1;
           arrow_allocation.height = min;
           if (priv->arrow_widget[0])
-            gtk_widget_size_allocate (priv->arrow_widget[0], &arrow_allocation);
+            gtk_widget_size_allocate (priv->arrow_widget[0], &arrow_allocation, -1, &arrow_clip);
           arrow_allocation.x += size1;
           arrow_allocation.width = size2;
           if (priv->arrow_widget[1])
-            gtk_widget_size_allocate (priv->arrow_widget[1], &arrow_allocation);
+            gtk_widget_size_allocate (priv->arrow_widget[1], &arrow_allocation, -1, &arrow_clip);
           allocation->y += min;
           allocation->height -= min;
         }
@@ -4588,11 +4588,11 @@ gtk_notebook_allocate_arrows (GtkNotebook   *notebook,
           arrow_allocation.width = size1;
           arrow_allocation.height = min;
           if (priv->arrow_widget[2])
-            gtk_widget_size_allocate (priv->arrow_widget[2], &arrow_allocation);
+            gtk_widget_size_allocate (priv->arrow_widget[2], &arrow_allocation, -1, &arrow_clip);
           arrow_allocation.x += size1;
           arrow_allocation.width = size2;
           if (priv->arrow_widget[3])
-            gtk_widget_size_allocate (priv->arrow_widget[3], &arrow_allocation);
+            gtk_widget_size_allocate (priv->arrow_widget[3], &arrow_allocation, -1, &arrow_clip);
           allocation->height -= min;
         }
       break;
@@ -5098,21 +5098,18 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook          *notebook,
         {
           GtkAllocation fixed_allocation = { priv->drag_window_x, priv->drag_window_y,
                                              child_allocation.width, child_allocation.height };
-          gtk_widget_size_allocate (page->tab_widget, &fixed_allocation);
-          gtk_widget_get_clip (page->tab_widget, &page_clip);
+          gtk_widget_size_allocate (page->tab_widget, &fixed_allocation, -1, &page_clip);
         }
       else if (page == priv->detached_tab && priv->operation == DRAG_OPERATION_DETACH)
         {
           /* needs to be allocated at 0,0
            * to be shown in the drag window */
           GtkAllocation fixed_allocation = { 0, 0, child_allocation.width, child_allocation.height };
-          gtk_widget_size_allocate (page->tab_widget, &fixed_allocation);
-          gtk_widget_get_clip (page->tab_widget, &page_clip);
+          gtk_widget_size_allocate (page->tab_widget, &fixed_allocation, -1, &page_clip);
         }
       else if (gtk_notebook_page_tab_label_is_visible (page))
         {
-          gtk_widget_size_allocate (page->tab_widget, &child_allocation);
-          gtk_widget_get_clip (page->tab_widget, &page_clip);
+          gtk_widget_size_allocate (page->tab_widget, &child_allocation, -1, &page_clip);
         }
 
       /* calculate whether to leave a gap based on reorder operation or not */
index baea9d35024d6e62fabb1590791e8c214eacd89c..71dfd2d8bdaafd1291c6c9cc7b85868b65eeca9e 100644 (file)
@@ -238,6 +238,7 @@ gtk_overlay_child_allocate (GtkOverlay      *overlay,
                             GtkOverlayChild *child)
 {
   GtkAllocation child_allocation;
+  GtkAllocation child_clip;
 
   if (!gtk_widget_get_visible (child->widget))
     return;
@@ -245,23 +246,25 @@ gtk_overlay_child_allocate (GtkOverlay      *overlay,
   gtk_overlay_compute_child_allocation (overlay, child, &child_allocation);
 
   gtk_overlay_child_update_style_classes (overlay, child->widget, &child_allocation);
-  gtk_widget_size_allocate (child->widget, &child_allocation);
+  gtk_widget_size_allocate (child->widget, &child_allocation, -1, &child_clip);
 }
 
 static void
-gtk_overlay_size_allocate (GtkWidget     *widget,
-                           GtkAllocation *allocation)
+gtk_overlay_size_allocate (GtkWidget           *widget,
+                           const GtkAllocation *allocation,
+                           int                  baseline,
+                           GtkAllocation       *out_clip)
 {
   GtkOverlay *overlay = GTK_OVERLAY (widget);
   GtkOverlayPrivate *priv = overlay->priv;
   GSList *children;
   GtkWidget *main_widget;
 
-  GTK_WIDGET_CLASS (gtk_overlay_parent_class)->size_allocate (widget, allocation);
+  GTK_WIDGET_CLASS (gtk_overlay_parent_class)->size_allocate (widget, allocation, baseline, out_clip);
 
   main_widget = gtk_bin_get_child (GTK_BIN (overlay));
   if (main_widget && gtk_widget_get_visible (main_widget))
-    gtk_widget_size_allocate (main_widget, allocation);
+    gtk_widget_size_allocate (main_widget, allocation, -1, out_clip);
 
   for (children = priv->children; children; children = children->next)
     gtk_overlay_child_allocate (overlay, children->data);
index 7ce9e5d2aeab863e560135f95315062cda5d624b..b22aca4c30299d15e56c80ad9f8e696f630bd299 100644 (file)
@@ -209,8 +209,10 @@ static void     gtk_paned_measure (GtkWidget *widget,
                                    int            *natural,
                                    int            *minimum_baseline,
                                    int            *natural_baseline);
-static void     gtk_paned_size_allocate         (GtkWidget        *widget,
-                                                 GtkAllocation    *allocation);
+static void     gtk_paned_size_allocate         (GtkWidget           *widget,
+                                                 const GtkAllocation *allocation,
+                                                 int                  baseline,
+                                                 GtkAllocation       *out_clip);
 static void     gtk_paned_unrealize             (GtkWidget        *widget);
 static void     gtk_paned_direction_changed     (GtkWidget        *widget,
                                                  GtkTextDirection  previous_direction);
@@ -1224,12 +1226,13 @@ gtk_paned_set_child_visible (GtkPaned  *paned,
 }
 
 static void
-gtk_paned_size_allocate (GtkWidget     *widget,
-                         GtkAllocation *allocation)
+gtk_paned_size_allocate (GtkWidget           *widget,
+                         const GtkAllocation *allocation,
+                         int                  baseline,
+                         GtkAllocation       *out_clip)
 {
   GtkPaned *paned = GTK_PANED (widget);
   GtkPanedPrivate *priv = paned->priv;
-  GtkAllocation clip = *allocation;
   GtkAllocation child_clip;
 
   if (priv->child1 && gtk_widget_get_visible (priv->child1) &&
@@ -1337,9 +1340,8 @@ gtk_paned_size_allocate (GtkWidget     *widget,
             child2_allocation.height = child2_height;
         }
 
-      gtk_widget_size_allocate (priv->handle_widget, &priv->handle_pos);
-      gtk_widget_get_clip (priv->handle_widget, &child_clip);
-      gdk_rectangle_union (&clip, &child_clip, &clip);
+      gtk_widget_size_allocate (priv->handle_widget, &priv->handle_pos, -1, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
 
       if (gtk_widget_get_mapped (widget) &&
           (old_handle_pos.x != priv->handle_pos.x ||
@@ -1356,13 +1358,11 @@ gtk_paned_size_allocate (GtkWidget     *widget,
         }
 
 
-      gtk_widget_size_allocate (priv->child1, &child1_allocation);
-      gtk_widget_get_clip (priv->child1, &child_clip);
-      gdk_rectangle_union (&clip, &child_clip, &clip);
+      gtk_widget_size_allocate (priv->child1, &child1_allocation, -1, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
 
-      gtk_widget_size_allocate (priv->child2, &child2_allocation);
-      gtk_widget_get_clip (priv->child2, &child_clip);
-      gdk_rectangle_union (&clip, &child_clip, &clip);
+      gtk_widget_size_allocate (priv->child2, &child2_allocation, -1, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
     }
   else
     {
@@ -1378,18 +1378,16 @@ gtk_paned_size_allocate (GtkWidget     *widget,
           gtk_paned_set_child_visible (paned, CHILD1, TRUE);
           gtk_paned_set_child_visible (paned, CHILD2, FALSE);
 
-          gtk_widget_size_allocate (priv->child1, &child_allocation);
-          gtk_widget_get_clip (priv->child1, &child_clip);
-          gdk_rectangle_union (&clip, &child_clip, &clip);
+          gtk_widget_size_allocate (priv->child1, &child_allocation, -1, &child_clip);
+          gdk_rectangle_union (out_clip, &child_clip, out_clip);
         }
       else if (priv->child2 && gtk_widget_get_visible (priv->child2))
         {
           gtk_paned_set_child_visible (paned, CHILD1, FALSE);
           gtk_paned_set_child_visible (paned, CHILD2, TRUE);
 
-          gtk_widget_size_allocate (priv->child2, &child_allocation);
-          gtk_widget_get_clip (priv->child2, &child_clip);
-          gdk_rectangle_union (&clip, &child_clip, &clip);
+          gtk_widget_size_allocate (priv->child2, &child_allocation, -1, &child_clip);
+          gdk_rectangle_union (out_clip, &child_clip, out_clip);
         }
       else
         {
@@ -1397,8 +1395,6 @@ gtk_paned_size_allocate (GtkWidget     *widget,
           gtk_paned_set_child_visible (paned, CHILD2, FALSE);
         }
     }
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 
index 399bb94f72fbb451cf16a8d4d5251109cb4bdf4c..3775505b709e51ef967e678bc639118700b7f395 100644 (file)
@@ -121,8 +121,10 @@ static void gtk_path_bar_measure (GtkWidget *widget,
                                   int            *minimum_baseline,
                                   int            *natural_baseline);
 static void gtk_path_bar_unmap                    (GtkWidget        *widget);
-static void gtk_path_bar_size_allocate            (GtkWidget        *widget,
-                                                  GtkAllocation    *allocation);
+static void gtk_path_bar_size_allocate            (GtkWidget           *widget,
+                                                   const GtkAllocation *allocation,
+                                                   int                  baseline,
+                                                   GtkAllocation       *out_clip);
 static void gtk_path_bar_add                      (GtkContainer     *container,
                                                   GtkWidget        *widget);
 static void gtk_path_bar_remove                   (GtkContainer     *container,
@@ -449,8 +451,10 @@ gtk_path_bar_unmap (GtkWidget *widget)
 /* This is a tad complicated
  */
 static void
-gtk_path_bar_size_allocate (GtkWidget     *widget,
-                           GtkAllocation *allocation)
+gtk_path_bar_size_allocate (GtkWidget           *widget,
+                            const GtkAllocation *allocation,
+                            int                  baseline,
+                            GtkAllocation       *out_clip)
 {
   GtkWidget *child;
   GtkPathBar *path_bar = GTK_PATH_BAR (widget);
@@ -463,16 +467,11 @@ gtk_path_bar_size_allocate (GtkWidget     *widget,
   gint up_slider_offset = 0;
   gint down_slider_offset = 0;
   GtkRequisition child_requisition;
-  GtkAllocation clip = *allocation;
   GtkAllocation child_clip;
 
   /* No path is set; we don't have to allocate anything. */
   if (path_bar->priv->button_list == NULL)
-    {
-      gtk_widget_set_clip (widget, allocation);
-
-      return;
-    }
+    return;
 
   direction = gtk_widget_get_direction (widget);
   allocation_width = allocation->width;
@@ -623,9 +622,8 @@ gtk_path_bar_size_allocate (GtkWidget     *widget,
        gtk_widget_set_tooltip_text (child, NULL);
       
       gtk_widget_set_child_visible (child, TRUE);
-      gtk_widget_size_allocate (child, &child_allocation);
-      gtk_widget_get_clip (child, &child_clip);
-      gdk_rectangle_union (&clip, &child_clip, &clip);
+      gtk_widget_size_allocate (child, &child_allocation, baseline, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
 
       if (direction == GTK_TEXT_DIR_RTL)
         {
@@ -654,9 +652,10 @@ gtk_path_bar_size_allocate (GtkWidget     *widget,
     {
       child_allocation.width = path_bar->priv->slider_width;
       child_allocation.x = up_slider_offset + allocation->x;
-      gtk_widget_size_allocate (path_bar->priv->up_slider_button, &child_allocation);
-      gtk_widget_get_clip (path_bar->priv->up_slider_button, &child_clip);
-      gdk_rectangle_union (&clip, &child_clip, &clip);
+      gtk_widget_size_allocate (path_bar->priv->up_slider_button,
+                                &child_allocation,
+                                -1, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
 
       gtk_widget_set_child_visible (path_bar->priv->up_slider_button, TRUE);
       gtk_widget_show (path_bar->priv->up_slider_button);
@@ -674,9 +673,10 @@ gtk_path_bar_size_allocate (GtkWidget     *widget,
       child_allocation.width = path_bar->priv->slider_width;
       child_allocation.x = down_slider_offset + allocation->x;
       
-      gtk_widget_size_allocate (path_bar->priv->down_slider_button, &child_allocation);
-      gtk_widget_get_clip (path_bar->priv->down_slider_button, &child_clip);
-      gdk_rectangle_union (&clip, &child_clip, &clip);
+      gtk_widget_size_allocate (path_bar->priv->down_slider_button,
+                                &child_allocation,
+                                -1, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
 
       gtk_widget_set_child_visible (path_bar->priv->down_slider_button, TRUE);
       gtk_widget_show (path_bar->priv->down_slider_button);
@@ -686,8 +686,6 @@ gtk_path_bar_size_allocate (GtkWidget     *widget,
     {
       gtk_widget_set_child_visible (path_bar->priv->down_slider_button, FALSE);
     }
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 static void
index b1ca46afe242f3a41af9e3aa950986dcf0a9ba42..06b2a2e8ef4db76ad9015492d20f0c009e70b9c0 100644 (file)
@@ -252,7 +252,7 @@ allocate_contents (GtkGizmo            *gizmo,
   GtkWidget *child = gtk_bin_get_child (GTK_BIN (popover));
 
   if (child)
-    gtk_widget_size_allocate (child, (GtkAllocation*)allocation);
+    gtk_widget_size_allocate (child, allocation, -1, out_clip);
 }
 
 static void
@@ -368,6 +368,7 @@ gtk_popover_get_property (GObject    *object,
 static gboolean
 transitions_enabled (GtkPopover *popover)
 {
+  /*return FALSE;*/
   return gtk_settings_get_enable_animations (gtk_widget_get_settings (GTK_WIDGET (popover)));
 }
 
@@ -1366,13 +1367,13 @@ gtk_popover_measure (GtkWidget      *widget,
 }
 
 static void
-gtk_popover_size_allocate (GtkWidget     *widget,
-                           GtkAllocation *allocation)
+gtk_popover_size_allocate (GtkWidget           *widget,
+                           const GtkAllocation *allocation,
+                           int                  baseline,
+                           GtkAllocation       *out_clip)
 {
   GtkPopover *popover = GTK_POPOVER (widget);
   GtkPopoverPrivate *priv = gtk_popover_get_instance_private (popover);
-  GtkAllocation child_clip;
-  GtkAllocation clip = *allocation;
   GtkAllocation child_alloc = *allocation;
 
   /* Note that we in measure() we add TAIL_HEIGHT in both directions, regardless
@@ -1401,9 +1402,7 @@ gtk_popover_size_allocate (GtkWidget     *widget,
       break;
     }
 
-  gtk_widget_size_allocate (priv->contents_widget, &child_alloc);
-  gtk_widget_get_clip (priv->contents_widget, &child_clip);
-  gdk_rectangle_union (&clip, &child_clip, &clip);
+  gtk_widget_size_allocate (priv->contents_widget, &child_alloc, -1, out_clip);
 
   if (gtk_widget_get_realized (widget))
     {
@@ -1413,8 +1412,6 @@ gtk_popover_size_allocate (GtkWidget     *widget,
                               a.x, a.y, a.width, a.height);
       gtk_popover_update_shape (popover);
     }
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 static gboolean
@@ -1835,9 +1832,11 @@ _gtk_popover_parent_unmap (GtkWidget *widget,
 }
 
 static void
-_gtk_popover_parent_size_allocate (GtkWidget     *widget,
-                                   GtkAllocation *allocation,
-                                   GtkPopover    *popover)
+_gtk_popover_parent_size_allocate (GtkWidget           *widget,
+                                   const GtkAllocation *allocation,
+                                   int                  baseline,
+                                   GtkAllocation       *out_clip,
+                                   GtkPopover          *popover)
 {
   gtk_popover_update_position (popover);
 }
index 3998f290d034283e928a54faef81d89bfa6ee430..30220320290e503b53248b346dde9bee08aed4eb 100644 (file)
@@ -140,8 +140,10 @@ static void gtk_progress_bar_get_property         (GObject        *object,
                                                    guint           prop_id,
                                                    GValue         *value,
                                                    GParamSpec     *pspec);
-static void gtk_progress_bar_size_allocate        (GtkWidget      *widget,
-                                                   GtkAllocation  *allocation);
+static void gtk_progress_bar_size_allocate        (GtkWidget           *widget,
+                                                   const GtkAllocation *allocation,
+                                                   int                  baseline,
+                                                   GtkAllocation       *out_clip);
 
 static void     gtk_progress_bar_snapshot         (GtkWidget      *widget,
                                                    GtkSnapshot    *snapshot);
@@ -445,8 +447,7 @@ allocate_trough (GtkGizmo            *gizmo,
         }
     }
 
-  gtk_widget_size_allocate (priv->progress_widget, &alloc);
-  gtk_widget_get_clip (priv->progress_widget, out_clip);
+  gtk_widget_size_allocate (priv->progress_widget, &alloc,-1, out_clip);
 
 }
 
@@ -624,10 +625,11 @@ get_current_text (GtkProgressBar *pbar)
 }
 
 static void
-gtk_progress_bar_size_allocate (GtkWidget     *widget,
-                                GtkAllocation *allocation)
+gtk_progress_bar_size_allocate (GtkWidget           *widget,
+                                const GtkAllocation *allocation,
+                                int                  baseline,
+                                GtkAllocation       *out_clip)
 {
-  GtkAllocation clip = *allocation;
   GtkAllocation child_clip = *allocation;
   GtkProgressBarPrivate *priv;
   gint bar_width, bar_height;
@@ -657,15 +659,11 @@ gtk_progress_bar_size_allocate (GtkWidget     *widget,
   alloc.width = bar_width;
   alloc.height = bar_height;
 
-  gtk_widget_size_allocate (priv->trough_widget, &alloc);
-  gtk_widget_get_clip (priv->trough_widget, &child_clip);
-  gdk_rectangle_union (&clip, &child_clip, &clip);
+  gtk_widget_size_allocate (priv->trough_widget, &alloc, -1, &child_clip);
+  gdk_rectangle_union (out_clip, &child_clip, out_clip);
 
   if (!priv->show_text)
-    {
-      gtk_widget_set_clip (widget, &clip);
-      return;
-    }
+    return;
 
   gtk_widget_measure (priv->label, GTK_ORIENTATION_HORIZONTAL, -1,
                       &text_min, &text_nat,
@@ -691,11 +689,8 @@ gtk_progress_bar_size_allocate (GtkWidget     *widget,
       alloc.height = text_height;
     }
 
-  gtk_widget_size_allocate (priv->label, &alloc);
-  gtk_widget_get_clip (priv->label, &text_clip);
-  gdk_rectangle_union (&clip, &text_clip, &clip);
-
-  gtk_widget_set_clip (widget, &clip);
+  gtk_widget_size_allocate (priv->label, &alloc, -1, &text_clip);
+  gdk_rectangle_union (out_clip, &text_clip, out_clip);
 }
 
 static void
index 839d22c0cd3d482b7e309479e61de3b752229d0d..2da3658fa23d02800f304f177771087d7c91ebe4 100644 (file)
@@ -162,8 +162,10 @@ static void gtk_range_measure        (GtkWidget      *widget,
                                       int            *natural,
                                       int            *minimum_baseline,
                                       int            *natural_baseline);
-static void gtk_range_size_allocate  (GtkWidget        *widget,
-                                      GtkAllocation    *allocation);
+static void gtk_range_size_allocate  (GtkWidget           *widget,
+                                      const GtkAllocation *allocation,
+                                      int                  baseline,
+                                      GtkAllocation       *out_clip);
 static void gtk_range_unmap          (GtkWidget        *widget);
 
 static void gtk_range_multipress_gesture_pressed  (GtkGestureMultiPress *gesture,
@@ -1422,8 +1424,7 @@ gtk_range_allocate_trough (GtkGizmo            *gizmo,
                                      gtk_adjustment_get_value (priv->adjustment),
                                      &slider_alloc);
 
-  gtk_widget_size_allocate (priv->slider_widget, &slider_alloc);
-  gtk_widget_get_clip (priv->slider_widget, out_clip);
+  gtk_widget_size_allocate (priv->slider_widget, &slider_alloc, -1, out_clip);
 
   if (gtk_adjustment_get_lower (priv->adjustment) == gtk_adjustment_get_upper (priv->adjustment))
     value = 0;
@@ -1465,8 +1466,7 @@ gtk_range_allocate_trough (GtkGizmo            *gizmo,
             fill_alloc.y += allocation->height - fill_alloc.height;
         }
 
-      gtk_widget_size_allocate (priv->fill_widget, &fill_alloc);
-      gtk_widget_get_clip (priv->fill_widget, &fill_clip);
+      gtk_widget_size_allocate (priv->fill_widget, &fill_alloc, -1, &fill_clip);
       gdk_rectangle_union (out_clip, &fill_clip, out_clip);
     }
 
@@ -1505,9 +1505,7 @@ gtk_range_allocate_trough (GtkGizmo            *gizmo,
           highlight_alloc.height = MAX (min, allocation->height* value);
         }
 
-      gtk_widget_size_allocate (priv->highlight_widget, &highlight_alloc);
-      gtk_widget_get_clip (priv->highlight_widget, &highlight_clip);
-      gdk_rectangle_union (out_clip, &highlight_clip, out_clip);
+      gtk_widget_size_allocate (priv->highlight_widget, &highlight_alloc, -1, &highlight_clip);
     }
 }
 
@@ -1599,13 +1597,13 @@ clamp_dimensions (const GtkAllocation *allocation,
 }
 
 static void
-gtk_range_size_allocate (GtkWidget     *widget,
-                         GtkAllocation *allocation)
+gtk_range_size_allocate (GtkWidget           *widget,
+                         const GtkAllocation *allocation,
+                         int                  baseline,
+                         GtkAllocation       *out_clip)
 {
   GtkRange *range = GTK_RANGE (widget);
   GtkRangePrivate *priv = range->priv;
-  GtkAllocation clip = *allocation;
-  GtkAllocation child_clip;
   GtkBorder border = { 0 };
   GtkAllocation box_alloc;
   int box_min_width, box_min_height;
@@ -1632,14 +1630,11 @@ gtk_range_size_allocate (GtkWidget     *widget,
   box_alloc.width = box_min_width;
   box_alloc.height = box_min_height;
 
-  gtk_widget_size_allocate (priv->trough_widget, &box_alloc);
-  gtk_widget_get_clip (priv->trough_widget, &child_clip);
+  gtk_widget_size_allocate (priv->trough_widget, &box_alloc, -1, out_clip);
 
   /* TODO: we should compute a proper clip from get_range_border(),
    * but this will at least give us outset shadows.
    */
-  gdk_rectangle_union (&child_clip, &clip, &clip);
-  gtk_widget_set_clip (widget, &clip);
 }
 
 static void
index 0d5009864b315918e68c09f25e9a0d5254509a81..862277e37735dbf55078c406d666ef4c762165fb 100644 (file)
@@ -154,15 +154,17 @@ gtk_recent_chooser_widget_snapshot (GtkWidget   *widget,
 }
 
 static void
-gtk_recent_chooser_widget_size_allocate (GtkWidget     *widget,
-                                       GtkAllocation *allocation)
+gtk_recent_chooser_widget_size_allocate (GtkWidget           *widget,
+                                         const GtkAllocation *allocation,
+                                         int                  baseline,
+                                         GtkAllocation       *out_clip)
 {
   GtkRecentChooserWidget *self = GTK_RECENT_CHOOSER_WIDGET (widget);
   GtkRecentChooserWidgetPrivate *priv = gtk_recent_chooser_widget_get_instance_private (self);
 
-  GTK_WIDGET_CLASS (gtk_recent_chooser_widget_parent_class)->size_allocate (widget, allocation);
+  GTK_WIDGET_CLASS (gtk_recent_chooser_widget_parent_class)->size_allocate (widget, allocation, -1, out_clip);
 
-  gtk_widget_size_allocate (priv->chooser, allocation);
+  gtk_widget_size_allocate (priv->chooser, allocation, -1, out_clip);
 }
 
 static void
index 1d2baf5c52205e1fd194d846bda7790262d9afb3..828453b8559fff064e3965df9e21c94d6ae28018 100644 (file)
@@ -94,8 +94,10 @@ static GParamSpec *props[LAST_PROP] = { NULL, };
 
 static void     gtk_revealer_real_add                            (GtkContainer  *widget,
                                                                   GtkWidget     *child);
-static void     gtk_revealer_real_size_allocate                  (GtkWidget     *widget,
-                                                                  GtkAllocation *allocation);
+static void     gtk_revealer_real_size_allocate                  (GtkWidget           *widget,
+                                                                  const GtkAllocation *allocation,
+                                                                  int                  baseline,
+                                                                  GtkAllocation       *out_clip);
 static void gtk_revealer_measure (GtkWidget      *widget,
                                   GtkOrientation  orientation,
                                   int             for_size,
@@ -293,9 +295,9 @@ effective_transition (GtkRevealer *revealer)
 }
 
 static void
-gtk_revealer_get_child_allocation (GtkRevealer   *revealer,
-                                   GtkAllocation *allocation,
-                                   GtkAllocation *child_allocation)
+gtk_revealer_get_child_allocation (GtkRevealer         *revealer,
+                                   const GtkAllocation *allocation,
+                                   GtkAllocation       *child_allocation)
 {
   GtkRevealerPrivate *priv = gtk_revealer_get_instance_private (revealer);
   GtkWidget *child;
@@ -357,12 +359,13 @@ gtk_revealer_real_add (GtkContainer *container,
 }
 
 static void
-gtk_revealer_real_size_allocate (GtkWidget     *widget,
-                                 GtkAllocation *allocation)
+gtk_revealer_real_size_allocate (GtkWidget           *widget,
+                                 const GtkAllocation *allocation,
+                                 int                  baseline,
+                                 GtkAllocation       *out_clip)
 {
   GtkRevealer *revealer = GTK_REVEALER (widget);
   GtkWidget *child;
-  GtkAllocation clip = *allocation;
 
   child = gtk_bin_get_child (GTK_BIN (revealer));
   if (child != NULL && gtk_widget_get_visible (child))
@@ -370,11 +373,8 @@ gtk_revealer_real_size_allocate (GtkWidget     *widget,
       GtkAllocation child_allocation;
 
       gtk_revealer_get_child_allocation (revealer, allocation, &child_allocation);
-      gtk_widget_size_allocate (child, &child_allocation);
-      gtk_widget_get_clip (child, &clip);
+      gtk_widget_size_allocate (child, &child_allocation, -1, out_clip);
     }
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 static void
index 75b89adce2894821815018fb7f29e73ccaf64abf..28431e77ec85355d9cfcf46b566ad42450aded70 100644 (file)
@@ -403,8 +403,7 @@ gtk_scale_allocate_value (GtkScale      *scale,
         }
     }
 
-  gtk_widget_size_allocate (priv->value_widget, &value_alloc);
-  gtk_widget_get_clip (priv->value_widget, out_clip);
+  gtk_widget_size_allocate (priv->value_widget, &value_alloc, -1, out_clip);
 }
 
 static void
@@ -451,8 +450,7 @@ gtk_scale_allocate_mark (GtkGizmo            *gizmo,
       indicator_alloc.height = indicator_height;
     }
 
-  gtk_widget_size_allocate_with_baseline (mark->indicator_widget, &indicator_alloc, baseline);
-  gtk_widget_get_clip (mark->indicator_widget, out_clip);
+  gtk_widget_size_allocate (mark->indicator_widget, &indicator_alloc, baseline, out_clip);
 
   if (mark->label_widget)
     {
@@ -473,8 +471,7 @@ gtk_scale_allocate_mark (GtkGizmo            *gizmo,
             label_alloc.x = indicator_alloc.x + indicator_alloc.width;
         }
 
-      gtk_widget_size_allocate_with_baseline (mark->label_widget, &label_alloc, baseline);
-      gtk_widget_get_clip (mark->label_widget, &label_clip);
+      gtk_widget_size_allocate (mark->label_widget, &label_alloc, baseline, &label_clip);
       gdk_rectangle_union (out_clip, &label_clip, out_clip);
     }
 }
@@ -531,8 +528,7 @@ gtk_scale_allocate_marks (GtkGizmo            *gizmo,
           mark_alloc.y -= mark_size / 2;
         }
 
-      gtk_widget_size_allocate_with_baseline (mark->widget, &mark_alloc, baseline);
-      gtk_widget_get_clip (mark->widget, &mark_clip);
+      gtk_widget_size_allocate (mark->widget, &mark_alloc, baseline, &mark_clip);
       gdk_rectangle_union (out_clip, &mark_clip, out_clip);
     }
 
@@ -540,16 +536,17 @@ gtk_scale_allocate_marks (GtkGizmo            *gizmo,
 }
 
 static void
-gtk_scale_size_allocate (GtkWidget     *widget,
-                         GtkAllocation *allocation)
+gtk_scale_size_allocate (GtkWidget           *widget,
+                         const GtkAllocation *allocation,
+                         int                  baseline,
+                         GtkAllocation       *out_clip)
 {
   GtkScale *scale = GTK_SCALE (widget);
   GtkScalePrivate *priv = scale->priv;
-  GtkAllocation clip = *allocation;
   GtkAllocation marks_clip, range_rect, marks_rect;
   GtkOrientation orientation;
 
-  GTK_WIDGET_CLASS (gtk_scale_parent_class)->size_allocate (widget, allocation);
+  GTK_WIDGET_CLASS (gtk_scale_parent_class)->size_allocate (widget, allocation, baseline, out_clip);
 
   orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (widget));
   gtk_range_get_range_rect (GTK_RANGE (scale), &range_rect);
@@ -567,9 +564,8 @@ gtk_scale_size_allocate (GtkWidget     *widget,
           marks_rect = range_rect;
           marks_rect.y = 0;
           marks_rect.height = marks_height;
-          gtk_widget_size_allocate (priv->top_marks_widget, &marks_rect);
-          gtk_widget_get_clip (priv->top_marks_widget, &marks_clip);
-          gdk_rectangle_union (&clip, &marks_clip, &clip);
+          gtk_widget_size_allocate (priv->top_marks_widget, &marks_rect, -1, &marks_clip);
+          gdk_rectangle_union (out_clip, &marks_clip, out_clip);
         }
 
       if (priv->bottom_marks_widget)
@@ -581,9 +577,8 @@ gtk_scale_size_allocate (GtkWidget     *widget,
           marks_rect = range_rect;
           marks_rect.y += range_rect.height;
           marks_rect.height = marks_height;
-          gtk_widget_size_allocate (priv->bottom_marks_widget, &marks_rect);
-          gtk_widget_get_clip (priv->bottom_marks_widget, &marks_clip);
-          gdk_rectangle_union (&clip, &marks_clip, &clip);
+          gtk_widget_size_allocate (priv->bottom_marks_widget, &marks_rect, -1, &marks_clip);
+          gdk_rectangle_union (out_clip, &marks_clip, out_clip);
         }
     }
   else
@@ -599,9 +594,8 @@ gtk_scale_size_allocate (GtkWidget     *widget,
           marks_rect = range_rect;
           marks_rect.x -= marks_width;
           marks_rect.width = marks_width;
-          gtk_widget_size_allocate (priv->top_marks_widget, &marks_rect);
-          gtk_widget_get_clip (priv->top_marks_widget, &marks_clip);
-          gdk_rectangle_union (&clip, &marks_clip, &clip);
+          gtk_widget_size_allocate (priv->top_marks_widget, &marks_rect, -1, &marks_clip);
+          gdk_rectangle_union (out_clip, &marks_clip, out_clip);
         }
 
       if (priv->bottom_marks_widget)
@@ -613,9 +607,8 @@ gtk_scale_size_allocate (GtkWidget     *widget,
           marks_rect = range_rect;
           marks_rect.x += range_rect.width;
           marks_rect.width = marks_width;
-          gtk_widget_size_allocate (priv->bottom_marks_widget, &marks_rect);
-          gtk_widget_get_clip (priv->bottom_marks_widget, &marks_clip);
-          gdk_rectangle_union (&clip, &marks_clip, &clip);
+          gtk_widget_size_allocate (priv->bottom_marks_widget, &marks_rect, -1, &marks_clip);
+          gdk_rectangle_union (out_clip, &marks_clip, out_clip);
         }
     }
 
@@ -624,10 +617,8 @@ gtk_scale_size_allocate (GtkWidget     *widget,
       GtkAllocation value_clip;
 
       gtk_scale_allocate_value (scale, &value_clip);
-      gdk_rectangle_union (&clip, &value_clip, &clip);
+      gdk_rectangle_union (out_clip, &value_clip, out_clip);
     }
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 #define add_slider_binding(binding_set, keyval, mask, scroll)              \
index 7d77f68468a47897ccf0935c686945c8c038556d..34d0d4c87b387bb3f57c0d9aa20b01f86e82c341 100644 (file)
@@ -120,15 +120,15 @@ gtk_scrollbar_measure (GtkWidget      *widget,
 }
 
 static void
-gtk_scrollbar_size_allocate (GtkWidget     *widget,
-                             GtkAllocation *allocation)
+gtk_scrollbar_size_allocate (GtkWidget           *widget,
+                             const GtkAllocation *allocation,
+                             int                  baseline,
+                             GtkAllocation       *out_clip)
 {
   GtkScrollbar *self = GTK_SCROLLBAR (widget);
   GtkScrollbarPrivate *priv = gtk_scrollbar_get_instance_private (self);
 
-  gtk_widget_size_allocate (priv->box, allocation);
-
-  gtk_widget_set_clip (widget, allocation);
+  gtk_widget_size_allocate (priv->box, allocation, -1, out_clip);
 }
 
 static void
index 14efd37ac5264ef902c52da4107ec76e6675da08..5310eace71442b182001a2a4681991c938b84e38 100644 (file)
@@ -311,8 +311,10 @@ static void     gtk_scrolled_window_finalize           (GObject           *objec
 static void     gtk_scrolled_window_destroy            (GtkWidget         *widget);
 static void     gtk_scrolled_window_snapshot           (GtkWidget         *widget,
                                                         GtkSnapshot       *snapshot);
-static void     gtk_scrolled_window_size_allocate      (GtkWidget         *widget,
-                                                        GtkAllocation     *allocation);
+static void     gtk_scrolled_window_size_allocate      (GtkWidget           *widget,
+                                                        const GtkAllocation *allocation,
+                                                        int                  baseline,
+                                                        GtkAllocation        *out_clip);
 static gboolean gtk_scrolled_window_scroll_event       (GtkWidget         *widget,
                                                         GdkEventScroll    *event);
 static gboolean gtk_scrolled_window_focus              (GtkWidget         *widget,
@@ -1347,8 +1349,10 @@ captured_event_cb (GtkWidget *widget,
 }
 
 static void
-gtk_scrolled_window_size_allocate (GtkWidget     *widget,
-                                   GtkAllocation *allocation)
+gtk_scrolled_window_size_allocate (GtkWidget           *widget,
+                                   const GtkAllocation *allocation,
+                                   int                  baseline,
+                                   GtkAllocation       *out_clip)
 {
   GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW (widget);
   GtkScrolledWindowPrivate *priv = scrolled_window->priv;
@@ -1583,24 +1587,24 @@ gtk_scrolled_window_size_allocate (GtkWidget     *widget,
   gtk_widget_set_child_visible (priv->hscrollbar, priv->hscrollbar_visible);
   if (priv->hscrollbar_visible)
     {
+      GtkAllocation clip;
       gtk_scrolled_window_allocate_scrollbar (scrolled_window,
                                               priv->hscrollbar,
                                               &child_allocation);
-      gtk_widget_size_allocate (priv->hscrollbar, &child_allocation);
+      gtk_widget_size_allocate (priv->hscrollbar, &child_allocation, -1, &clip);
     }
 
   gtk_widget_set_child_visible (priv->vscrollbar, priv->vscrollbar_visible);
   if (priv->vscrollbar_visible)
     {
+      GtkAllocation clip;
       gtk_scrolled_window_allocate_scrollbar (scrolled_window,
                                               priv->vscrollbar,
                                               &child_allocation);
-      gtk_widget_size_allocate (priv->vscrollbar, &child_allocation);
+      gtk_widget_size_allocate (priv->vscrollbar, &child_allocation, -1, &clip);
     }
 
   gtk_scrolled_window_check_attach_pan_gesture (scrolled_window);
-
-  gtk_widget_set_clip (widget, allocation);
 }
 
 static void
@@ -2975,6 +2979,7 @@ gtk_scrolled_window_allocate_child (GtkScrolledWindow   *swindow,
   GtkScrolledWindowPrivate *priv = gtk_scrolled_window_get_instance_private (swindow);
   GtkWidget     *widget = GTK_WIDGET (swindow), *child;
   GtkAllocation  child_allocation;
+  GtkAllocation child_clip;
   int sb_width;
   int sb_height;
 
@@ -3016,7 +3021,7 @@ gtk_scrolled_window_allocate_child (GtkScrolledWindow   *swindow,
       child_allocation.height = MAX (1, child_allocation.height - sb_height);
     }
 
-  gtk_widget_size_allocate (child, &child_allocation);
+  gtk_widget_size_allocate (child, &child_allocation, -1, &child_clip);
 }
 
 static void
index 5306b8e95b1bc9e1f7bb7987294ee16f9e0ef566..ebb2f5070255f61ca19df27593950bf3f2b6b91d 100644 (file)
@@ -123,21 +123,12 @@ gtk_separator_init (GtkSeparator *separator)
   _gtk_orientable_set_style_classes (GTK_ORIENTABLE (separator));
 }
 
-static void
-gtk_separator_size_allocate (GtkWidget     *widget,
-                             GtkAllocation *allocation)
-{
-  gtk_widget_set_clip (widget, allocation);
-}
-
 static void
 gtk_separator_class_init (GtkSeparatorClass *class)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (class);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
 
-  widget_class->size_allocate = gtk_separator_size_allocate;
-
   object_class->set_property = gtk_separator_set_property;
   object_class->get_property = gtk_separator_get_property;
 
index 4893ab8fcc8800eb180c2a6bdba1b96668165aa8..3cd9f2c1c2b59cec8e84206607b91a051249317d 100644 (file)
@@ -68,8 +68,6 @@ static void     gtk_separator_tool_item_get_property      (GObject
                                                            guint                      prop_id,
                                                            GValue                    *value,
                                                            GParamSpec                *pspec);
-static void     gtk_separator_tool_item_size_allocate     (GtkWidget                 *widget,
-                                                           GtkAllocation             *allocation);
 static void     gtk_separator_tool_item_add               (GtkContainer              *container,
                                                            GtkWidget                 *child);
 
@@ -91,8 +89,6 @@ gtk_separator_tool_item_class_init (GtkSeparatorToolItemClass *class)
   object_class->set_property = gtk_separator_tool_item_set_property;
   object_class->get_property = gtk_separator_tool_item_get_property;
 
-  widget_class->size_allocate = gtk_separator_tool_item_size_allocate;
-
   toolitem_class->create_menu_proxy = gtk_separator_tool_item_create_menu_proxy;
   
   container_class->add = gtk_separator_tool_item_add;
@@ -178,13 +174,6 @@ gtk_separator_tool_item_get_property (GObject      *object,
     }
 }
 
-static void
-gtk_separator_tool_item_size_allocate (GtkWidget     *widget,
-                                       GtkAllocation *allocation)
-{
-  gtk_widget_set_clip (widget, allocation);
-}
-
 /**
  * gtk_separator_tool_item_new:
  * 
index 6815c0d985b57de86888c19c2271f5902db80b88..6ae53665ce31fee7aab01f8871d6b56d216f2d20 100644 (file)
@@ -516,12 +516,14 @@ gtk_shortcuts_shortcut_snapshot (GtkWidget   *widget,
 }
 
 static void
-gtk_shortcuts_shortcut_size_allocate (GtkWidget     *widget,
-                                      GtkAllocation *allocation)
+gtk_shortcuts_shortcut_size_allocate (GtkWidget           *widget,
+                                      const GtkAllocation *allocation,
+                                      int                  baseline,
+                                      GtkAllocation       *out_clip)
 {
-  GTK_WIDGET_CLASS (gtk_shortcuts_shortcut_parent_class)->size_allocate (widget, allocation);
+  GTK_WIDGET_CLASS (gtk_shortcuts_shortcut_parent_class)->size_allocate (widget, allocation, baseline, out_clip);
 
-  gtk_widget_size_allocate (GTK_WIDGET (GTK_SHORTCUTS_SHORTCUT (widget)->box), allocation);
+  gtk_widget_size_allocate (GTK_WIDGET (GTK_SHORTCUTS_SHORTCUT (widget)->box), allocation, -1, out_clip);
 }
 
 static void
index d1eaef20c7b2bc142a0927c94fcadbd287a9f198..2593cd8bd1d7c3fff3e5c205facd1589fa4681a4 100644 (file)
@@ -253,8 +253,10 @@ static void gtk_spin_button_measure (GtkWidget      *widget,
                                      int            *natural,
                                      int            *minimum_baseline,
                                      int            *natural_baseline);
-static void gtk_spin_button_size_allocate  (GtkWidget          *widget,
-                                            GtkAllocation      *allocation);
+static void gtk_spin_button_size_allocate  (GtkWidget           *widget,
+                                            const GtkAllocation *allocation,
+                                            int                  baseline,
+                                            GtkAllocation       *out_clip);
 static gint gtk_spin_button_focus_out      (GtkWidget          *widget,
                                             GdkEventFocus      *event);
 static void gtk_spin_button_grab_notify    (GtkWidget          *widget,
@@ -1055,17 +1057,14 @@ gtk_spin_button_measure (GtkWidget      *widget,
 }
 
 static void
-gtk_spin_button_size_allocate (GtkWidget     *widget,
-                               GtkAllocation *allocation)
+gtk_spin_button_size_allocate (GtkWidget           *widget,
+                               const GtkAllocation *allocation,
+                               int                  baseline,
+                               GtkAllocation       *out_clip)
 {
   GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (GTK_SPIN_BUTTON (widget));
-  GtkAllocation clip = *allocation;
 
-  gtk_widget_size_allocate_with_baseline (priv->box, allocation,
-                                          gtk_widget_get_allocated_baseline (widget));
-  gtk_widget_get_clip (priv->box, &clip);
-
-  gtk_widget_set_clip (widget, &clip);
+  gtk_widget_size_allocate (priv->box, allocation, baseline, out_clip);
 }
 
 static gint
index 12c98aa39cf1a9020faeb0df4d9475a2953b6866..3b4fc7dc63ba9d6594e49b5bafa22f8b52ff5f96 100644 (file)
@@ -103,13 +103,6 @@ gtk_spinner_measure (GtkWidget      *widget,
     *minimum = *natural = DEFAULT_SIZE;
 }
 
-static void
-gtk_spinner_size_allocate (GtkWidget     *widget,
-                           GtkAllocation *allocation)
-{
-  gtk_widget_set_clip (widget, allocation);
-}
-
 static void
 gtk_spinner_snapshot (GtkWidget   *widget,
                       GtkSnapshot *snapshot)
@@ -195,7 +188,6 @@ gtk_spinner_class_init (GtkSpinnerClass *klass)
   gobject_class->set_property = gtk_spinner_set_property;
 
   widget_class = GTK_WIDGET_CLASS(klass);
-  widget_class->size_allocate = gtk_spinner_size_allocate;
   widget_class->snapshot = gtk_spinner_snapshot;
   widget_class->measure = gtk_spinner_measure;
 
index b1d515a9a35a1be13ea519523d313127b5a455f4..b77bde2cf6d966b3a186709dc58c084e0666a4a4 100644 (file)
@@ -168,8 +168,10 @@ static void     gtk_stack_forall                         (GtkContainer  *contain
 static void     gtk_stack_compute_expand                 (GtkWidget     *widget,
                                                           gboolean      *hexpand,
                                                           gboolean      *vexpand);
-static void     gtk_stack_size_allocate                  (GtkWidget     *widget,
-                                                          GtkAllocation *allocation);
+static void     gtk_stack_size_allocate                  (GtkWidget           *widget,
+                                                          const GtkAllocation *allocation,
+                                                          int                  baseline,
+                                                          GtkAllocation       *out_clip);
 static void     gtk_stack_snapshot                       (GtkWidget     *widget,
                                                           GtkSnapshot   *snapshot);
 static void     gtk_stack_measure                        (GtkWidget      *widget,
@@ -2027,12 +2029,13 @@ gtk_stack_snapshot (GtkWidget   *widget,
 }
 
 static void
-gtk_stack_size_allocate (GtkWidget     *widget,
-                         GtkAllocation *allocation)
+gtk_stack_size_allocate (GtkWidget           *widget,
+                         const GtkAllocation *allocation,
+                         int                  baseline,
+                         GtkAllocation       *out_clip)
 {
   GtkStack *stack = GTK_STACK (widget);
   GtkStackPrivate *priv = gtk_stack_get_instance_private (stack);
-  GtkAllocation clip = *allocation;
   GdkRectangle child_clip;
   GtkAllocation child_allocation;
 
@@ -2052,10 +2055,8 @@ gtk_stack_size_allocate (GtkWidget     *widget,
                           &min, &nat, NULL, NULL);
       child_allocation.height = MAX (min, allocation->height);
 
-      gtk_widget_size_allocate (priv->last_visible_child->widget, &child_allocation);
-      gtk_widget_get_clip (priv->last_visible_child->widget, &child_clip);
-      gdk_rectangle_union (&clip, &child_clip, &clip);
-
+      gtk_widget_size_allocate (priv->last_visible_child->widget, &child_allocation, -1, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
 
       if (!gdk_rectangle_equal (&priv->last_visible_surface_allocation,
                                 &child_allocation))
@@ -2100,12 +2101,9 @@ gtk_stack_size_allocate (GtkWidget     *widget,
             child_allocation.x = (allocation->height - child_allocation.height);
         }
 
-      gtk_widget_size_allocate (priv->visible_child->widget, &child_allocation);
-      gtk_widget_get_clip (priv->visible_child->widget, &child_clip);
-      gdk_rectangle_union (&clip, &child_clip, &clip);
+      gtk_widget_size_allocate (priv->visible_child->widget, &child_allocation, -1, &child_clip);
+      gdk_rectangle_union (out_clip, &child_clip, out_clip);
     }
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 #define LERP(a, b, t) ((a) + (((b) - (a)) * (1.0 - (t))))
index bddd46fa2615104f4aa471b62a9bfbeaf13016d7..8c3ce372c5db3352c3ab493877790dcb1887f4d5 100644 (file)
@@ -323,12 +323,13 @@ gtk_switch_measure (GtkWidget      *widget,
 }
 
 static void
-gtk_switch_size_allocate (GtkWidget     *widget,
-                          GtkAllocation *allocation)
+gtk_switch_size_allocate (GtkWidget           *widget,
+                          const GtkAllocation *allocation,
+                          int                  baseline,
+                          GtkAllocation       *out_clip)
 {
   GtkSwitch *self = GTK_SWITCH (widget);
   GtkSwitchPrivate *priv = gtk_switch_get_instance_private (self);
-  GtkAllocation clip = *allocation;
   GtkAllocation child_clip;
   GtkAllocation child_alloc;
   GtkAllocation slider_alloc;
@@ -339,9 +340,9 @@ gtk_switch_size_allocate (GtkWidget     *widget,
   slider_alloc.width = allocation->width / 2;
   slider_alloc.height = allocation->height;
 
-  gtk_widget_size_allocate (priv->slider, &slider_alloc);
+  gtk_widget_size_allocate (priv->slider, &slider_alloc, -1, &child_clip);
   gtk_widget_get_clip (priv->slider, &child_clip);
-  gdk_rectangle_union (&child_clip, &clip, &clip);
+  gdk_rectangle_union (out_clip, &child_clip, out_clip);
 
 
   /* Center ON label in left half */
@@ -351,9 +352,8 @@ gtk_switch_size_allocate (GtkWidget     *widget,
   gtk_widget_measure (priv->on_label, GTK_ORIENTATION_VERTICAL, min, &min, NULL, NULL, NULL);
   child_alloc.y = (allocation->height - min) / 2;
   child_alloc.height = min;
-  gtk_widget_size_allocate (priv->on_label, &child_alloc);
-  gtk_widget_get_clip (priv->on_label, &child_clip);
-  gdk_rectangle_union (&child_clip, &clip, &clip);
+  gtk_widget_size_allocate (priv->on_label, &child_alloc, -1, &child_clip);
+  gdk_rectangle_union (out_clip, &child_clip, out_clip);
 
   /* Center OFF label in right half */
   gtk_widget_measure (priv->off_label, GTK_ORIENTATION_HORIZONTAL, -1, &min, NULL, NULL, NULL);
@@ -362,11 +362,8 @@ gtk_switch_size_allocate (GtkWidget     *widget,
   gtk_widget_measure (priv->off_label, GTK_ORIENTATION_VERTICAL, min, &min, NULL, NULL, NULL);
   child_alloc.y = (allocation->height - min) / 2;
   child_alloc.height = min;
-  gtk_widget_size_allocate (priv->off_label, &child_alloc);
-  gtk_widget_get_clip (priv->off_label, &child_clip);
-  gdk_rectangle_union (&child_clip, &clip, &clip);
-
-  gtk_widget_set_clip (widget, &clip);
+  gtk_widget_size_allocate (priv->off_label, &child_alloc, -1, &child_clip);
+  gdk_rectangle_union (out_clip, &child_clip, out_clip);
 }
 
 static void
index edd39ac4482c2c2c80c005fe5bd9a912c03552cc..6a5244582689a262f123f9c1382c70ed3d40b36b 100644 (file)
@@ -386,8 +386,10 @@ static void gtk_text_view_measure (GtkWidget      *widget,
                                    int            *natural,
                                    int            *minimum_baseline,
                                    int            *natural_baseline);
-static void gtk_text_view_size_allocate        (GtkWidget        *widget,
-                                                GtkAllocation    *allocation);
+static void gtk_text_view_size_allocate        (GtkWidget           *widget,
+                                                const GtkAllocation *allocation,
+                                                int                  baseline,
+                                                GtkAllocation       *out_clip);
 static void gtk_text_view_realize              (GtkWidget        *widget);
 static void gtk_text_view_unrealize            (GtkWidget        *widget);
 static void gtk_text_view_map                  (GtkWidget        *widget);
@@ -4066,10 +4068,11 @@ gtk_text_view_update_child_allocation (GtkTextView      *text_view,
                                        GtkTextViewChild *vc)
 {
   GtkAllocation allocation;
+  GtkAllocation clip;
 
   gtk_text_view_compute_child_allocation (text_view, vc, &allocation);
   
-  gtk_widget_size_allocate (vc->widget, &allocation);
+  gtk_widget_size_allocate (vc->widget, &allocation, -1, &clip);
 
 #if 0
   g_print ("allocation for %p allocated to %d,%d yoffset = %d\n",
@@ -4151,6 +4154,7 @@ gtk_text_view_allocate_children (GtkTextView *text_view)
       else
         {
           GtkAllocation allocation;
+          GtkAllocation clip;
           GtkRequisition child_req;
              
           allocation.x = child->x;
@@ -4170,7 +4174,7 @@ gtk_text_view_allocate_children (GtkTextView *text_view)
           allocation.width = child_req.width;
           allocation.height = child_req.height;
           
-          gtk_widget_size_allocate (child->widget, &allocation);          
+          gtk_widget_size_allocate (child->widget, &allocation, -1, &clip);
         }
 
       tmp_list = tmp_list->next;
@@ -4178,8 +4182,10 @@ gtk_text_view_allocate_children (GtkTextView *text_view)
 }
 
 static void
-gtk_text_view_size_allocate (GtkWidget *widget,
-                             GtkAllocation *allocation)
+gtk_text_view_size_allocate (GtkWidget           *widget,
+                             const GtkAllocation *allocation,
+                             int                  baseline,
+                             GtkAllocation       *out_clip)
 {
   GtkTextView *text_view;
   GtkTextViewPrivate *priv;
@@ -4294,8 +4300,6 @@ gtk_text_view_size_allocate (GtkWidget *widget,
    * chance to run. So we do the work here. 
    */
   gtk_text_view_flush_first_validate (text_view);
-
-  gtk_widget_set_clip (widget, allocation);
 }
 
 static void
@@ -8677,6 +8681,7 @@ adjust_allocation (GtkWidget *widget,
                    int        dy)
 {
   GtkAllocation allocation;
+  GtkAllocation clip;
 
   if (!gtk_widget_is_drawable (widget))
     return;
@@ -8684,7 +8689,7 @@ adjust_allocation (GtkWidget *widget,
   gtk_widget_get_allocation (widget, &allocation);
   allocation.x += dx;
   allocation.y += dy;
-  gtk_widget_size_allocate (widget, &allocation);
+  gtk_widget_size_allocate (widget, &allocation, -1, &clip);
 }
 
 static void
index f8fa09dc01e3a35262a81207f2e9fbe65cf60dda..1244cfba40036b47a329633ef3df4e5557921c9e 100644 (file)
@@ -194,7 +194,9 @@ static void       gtk_toolbar_get_property         (GObject             *object,
 static void       gtk_toolbar_snapshot             (GtkWidget           *widget,
                                                     GtkSnapshot         *snapshot);
 static void       gtk_toolbar_size_allocate        (GtkWidget           *widget,
-                                                   GtkAllocation       *allocation);
+                                                    const GtkAllocation *allocation,
+                                                    int                  baseline,
+                                                    GtkAllocation       *out_clip);
 static void       gtk_toolbar_style_updated        (GtkWidget           *widget);
 static gboolean   gtk_toolbar_focus                (GtkWidget           *widget,
                                                    GtkDirectionType     dir);
@@ -1263,8 +1265,10 @@ rebuild_menu (GtkToolbar *toolbar)
 }
 
 static void
-gtk_toolbar_size_allocate (GtkWidget     *widget,
-                           GtkAllocation *allocation)
+gtk_toolbar_size_allocate (GtkWidget           *widget,
+                           const GtkAllocation *allocation,
+                           int                  baseline,
+                           GtkAllocation       *out_clip)
 {
   GtkToolbar *toolbar = GTK_TOOLBAR (widget);
   GtkToolbarPrivate *priv = toolbar->priv;
@@ -1571,8 +1575,7 @@ gtk_toolbar_size_allocate (GtkWidget     *widget,
 
   if (need_arrow)
     {
-      gtk_widget_size_allocate (GTK_WIDGET (priv->arrow_button),
-                                &arrow_allocation);
+      gtk_widget_size_allocate (GTK_WIDGET (priv->arrow_button), &arrow_allocation, -1, out_clip);
       gtk_widget_show (GTK_WIDGET (priv->arrow_button));
     }
   else
@@ -1585,8 +1588,6 @@ gtk_toolbar_size_allocate (GtkWidget     *widget,
 
   g_free (allocations);
   g_free (new_states);
-
-  gtk_widget_set_clip (widget, allocation);
 }
 
 static void
@@ -3117,9 +3118,10 @@ static void
 toolbar_content_size_allocate (ToolbarContent *content,
                               GtkAllocation  *allocation)
 {
+  GtkAllocation clip;
+
   content->allocation = *allocation;
-  gtk_widget_size_allocate (GTK_WIDGET (content->item),
-                            allocation);
+  gtk_widget_size_allocate (GTK_WIDGET (content->item), allocation, -1, &clip);
 }
 
 static void
index e9375f21217e3409b5e1ce276bc9f9ddc93aa103..962e7e7e0acb4cb6033381e4e34d9cf5b49580a7 100644 (file)
@@ -879,8 +879,10 @@ gtk_tool_item_group_real_size_query (GtkWidget      *widget,
 }
 
 static void
-gtk_tool_item_group_real_size_allocate (GtkWidget     *widget,
-                                        GtkAllocation *allocation)
+gtk_tool_item_group_real_size_allocate (GtkWidget           *widget,
+                                        const GtkAllocation *allocation,
+                                        int                  baseline,
+                                        GtkAllocation       *out_clip)
 {
   GtkToolItemGroup *group = GTK_TOOL_ITEM_GROUP (widget);
   GtkToolItemGroupPrivate* priv = group->priv;
@@ -903,7 +905,8 @@ gtk_tool_item_group_real_size_allocate (GtkWidget     *widget,
   orientation = gtk_tool_shell_get_orientation (GTK_TOOL_SHELL (group));
 
   /* chain up */
-  GTK_WIDGET_CLASS (gtk_tool_item_group_parent_class)->size_allocate (widget, allocation);
+  GTK_WIDGET_CLASS (gtk_tool_item_group_parent_class)->size_allocate (widget, allocation,
+                                                                      baseline, out_clip);
 
   child_allocation.x = 0;
   child_allocation.y = 0;
@@ -928,7 +931,7 @@ gtk_tool_item_group_real_size_allocate (GtkWidget     *widget,
             child_allocation.x = allocation->width - child_allocation.width;
         }
 
-      gtk_widget_size_allocate (priv->header, &child_allocation);
+      gtk_widget_size_allocate (priv->header, &child_allocation, -1, out_clip);
 
       if (GTK_ORIENTATION_VERTICAL == orientation)
         child_allocation.y += child_allocation.height;
@@ -1055,7 +1058,7 @@ gtk_tool_item_group_real_size_allocate (GtkWidget     *widget,
 
           child_allocation.height = item_size.height;
 
-          gtk_widget_size_allocate (GTK_WIDGET (child->item), &child_allocation);
+          gtk_widget_size_allocate (GTK_WIDGET (child->item), &child_allocation, -1, out_clip);
           gtk_widget_set_child_visible (GTK_WIDGET (child->item), TRUE);
         }
 
@@ -1076,12 +1079,12 @@ gtk_tool_item_group_real_size_allocate (GtkWidget     *widget,
 }
 
 static void
-gtk_tool_item_group_size_allocate (GtkWidget     *widget,
-                                   GtkAllocation *allocation)
+gtk_tool_item_group_size_allocate (GtkWidget           *widget,
+                                   const GtkAllocation *allocation,
+                                   int                  baseline,
+                                   GtkAllocation       *out_clip)
 {
-  gtk_tool_item_group_real_size_allocate (widget, allocation);
-
-  gtk_widget_queue_draw (widget);
+  gtk_tool_item_group_real_size_allocate (widget, allocation, baseline, out_clip);
 }
 
 static void
index 90e069951a47c12aa4bfd3a6e61b728aa62f6c15..5c8754d837986f51a6a5beb1cf0dae74ce96ffaa 100644 (file)
@@ -472,8 +472,10 @@ gtk_tool_palette_measure (GtkWidget      *widget,
 
 
 static void
-gtk_tool_palette_size_allocate (GtkWidget     *widget,
-                                GtkAllocation *allocation)
+gtk_tool_palette_size_allocate (GtkWidget           *widget,
+                                const GtkAllocation *allocation,
+                                int                  baseline,
+                                GtkAllocation       *out_clip)
 {
   GtkToolPalette *palette = GTK_TOOL_PALETTE (widget);
   GtkAdjustment *adjustment = NULL;
@@ -496,7 +498,8 @@ gtk_tool_palette_size_allocate (GtkWidget     *widget,
 
   direction = gtk_widget_get_direction (widget);
 
-  GTK_WIDGET_CLASS (gtk_tool_palette_parent_class)->size_allocate (widget, allocation);
+  GTK_WIDGET_CLASS (gtk_tool_palette_parent_class)->size_allocate (widget, allocation,
+                                                                   baseline, out_clip);
 
   if (GTK_ORIENTATION_VERTICAL == palette->priv->orientation)
     {
@@ -640,7 +643,7 @@ gtk_tool_palette_size_allocate (GtkWidget     *widget,
           else
             child_allocation.x = x;
 
-          gtk_widget_size_allocate (GTK_WIDGET (group->widget), &child_allocation);
+          gtk_widget_size_allocate (GTK_WIDGET (group->widget), &child_allocation, -1, out_clip);
           gtk_widget_show (GTK_WIDGET (group->widget));
 
           if (GTK_ORIENTATION_VERTICAL == palette->priv->orientation)
@@ -702,10 +705,11 @@ gtk_tool_palette_adjustment_value_changed (GtkAdjustment *adjustment,
                                            gpointer       data)
 {
   GtkAllocation allocation;
+  GtkAllocation clip;
   GtkWidget *widget = GTK_WIDGET (data);
 
   gtk_widget_get_allocation (widget, &allocation);
-  gtk_tool_palette_size_allocate (widget, &allocation);
+  gtk_tool_palette_size_allocate (widget, &allocation, -1, &clip);
 }
 
 static void
index b48d706c1578ca971a9bca3e812f16d4db244230..1c1ede9f4c406c4725fb11228a08fe7aec5796fa 100644 (file)
@@ -592,8 +592,10 @@ static void     gtk_tree_view_measure              (GtkWidget        *widget,
                                                     int            *natural,
                                                     int            *minimum_baseline,
                                                     int            *natural_baseline);
-static void     gtk_tree_view_size_allocate        (GtkWidget        *widget,
-                                                   GtkAllocation    *allocation);
+static void     gtk_tree_view_size_allocate        (GtkWidget           *widget,
+                                                    const GtkAllocation *allocation,
+                                                    int                  baseline,
+                                                    GtkAllocation       *out_clip);
 static void     gtk_tree_view_snapshot             (GtkWidget        *widget,
                                                     GtkSnapshot      *snapshot);
 static gboolean gtk_tree_view_key_press            (GtkWidget        *widget,
@@ -2553,6 +2555,7 @@ gtk_tree_view_size_allocate_drag_column (GtkWidget *widget)
 {
   GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
   GtkAllocation drag_allocation;
+  GtkAllocation clip;
   GtkWidget *button;
 
   if (tree_view->priv->drag_column == NULL)
@@ -2564,12 +2567,14 @@ gtk_tree_view_size_allocate_drag_column (GtkWidget *widget)
   drag_allocation.y = 0;
   drag_allocation.width = gdk_window_get_width (tree_view->priv->drag_window);
   drag_allocation.height = gdk_window_get_height (tree_view->priv->drag_window);
-  gtk_widget_size_allocate (button, &drag_allocation);
+  gtk_widget_size_allocate (button, &drag_allocation, -1, &clip);
 }
 
 static void
-gtk_tree_view_size_allocate (GtkWidget     *widget,
-                            GtkAllocation *allocation)
+gtk_tree_view_size_allocate (GtkWidget           *widget,
+                             const GtkAllocation *allocation,
+                             int                  baseline,
+                             GtkAllocation       *out_clip)
 {
   GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
   GList *tmp_list;
@@ -2743,10 +2748,8 @@ gtk_tree_view_size_allocate (GtkWidget     *widget,
       child_rect.y = MAX (min_y, MIN (max_y, child_rect.y));
 
       gtk_tree_path_free (path);
-      gtk_widget_size_allocate (child->widget, &child_rect);
+      gtk_widget_size_allocate (child->widget, &child_rect, -1, out_clip);
     }
-
-  gtk_widget_set_clip (widget, allocation);
 }
 
 /* Grabs the focus and unsets the GTK_TREE_VIEW_DRAW_KEYFOCUS flag */
@@ -9642,6 +9645,7 @@ _gtk_tree_view_column_start_drag (GtkTreeView       *tree_view,
                                   GdkDevice         *device)
 {
   GtkAllocation allocation;
+  GtkAllocation clip;
   GtkAllocation button_allocation;
   GtkWidget *button;
   GtkStyleContext *context;
@@ -9679,7 +9683,7 @@ _gtk_tree_view_column_start_drag (GtkTreeView       *tree_view,
   tree_view->priv->drag_column_x = button_allocation.x;
   allocation = button_allocation;
   allocation.x = 0;
-  gtk_widget_size_allocate (button, &allocation);
+  gtk_widget_size_allocate (button, &allocation, -1, &clip);
 
   tree_view->priv->drag_column = column;
   gdk_window_show (tree_view->priv->drag_window);
index 8e20cd1bb41608c65bbca78c58a39b9a4c2cdfcf..d989e4dcc46a22beb2730831ff9aaccdb787a047 100644 (file)
@@ -2072,6 +2072,7 @@ _gtk_tree_view_column_allocate (GtkTreeViewColumn *tree_column,
   gboolean                  rtl;
   GtkAllocation             allocation = { 0, 0, 0, 0 };
   GtkAllocation             widget_allocation;
+  GtkAllocation clip;
 
   g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
 
@@ -2093,7 +2094,7 @@ _gtk_tree_view_column_allocate (GtkTreeViewColumn *tree_column,
       allocation.width  = width;
       allocation.height = _gtk_tree_view_get_header_height (GTK_TREE_VIEW (priv->tree_view));
 
-      gtk_widget_size_allocate (priv->button, &allocation);
+      gtk_widget_size_allocate (priv->button, &allocation, -1, &clip);
     }
 
   if (priv->window)
index e633844109220f69c89dce049a8501faeb5ca558..54ff2b1f4800305f1593d2e9918eecffde8f0b64 100644 (file)
@@ -98,8 +98,10 @@ static void gtk_viewport_get_property             (GObject         *object,
 static void gtk_viewport_destroy                  (GtkWidget        *widget);
 static void gtk_viewport_snapshot                 (GtkWidget        *widget,
                                                   GtkSnapshot      *snapshot);
-static void gtk_viewport_size_allocate            (GtkWidget        *widget,
-                                                  GtkAllocation    *allocation);
+static void gtk_viewport_size_allocate            (GtkWidget           *widget,
+                                                   const GtkAllocation *allocation,
+                                                   int                  baseline,
+                                                   GtkAllocation       *out_clip);
 static void gtk_viewport_adjustment_value_changed (GtkAdjustment    *adjustment,
                                                   gpointer          data);
 static void viewport_set_adjustment               (GtkViewport      *viewport,
@@ -503,12 +505,13 @@ gtk_viewport_snapshot (GtkWidget   *widget,
 }
 
 static void
-gtk_viewport_size_allocate (GtkWidget     *widget,
-                            GtkAllocation *allocation)
+gtk_viewport_size_allocate (GtkWidget           *widget,
+                            const GtkAllocation *allocation,
+                            int                  baseline,
+                            GtkAllocation       *out_clip)
 {
   GtkViewport *viewport = GTK_VIEWPORT (widget);
   GtkViewportPrivate *priv = viewport->priv;
-  GtkAllocation clip = *allocation;
   GtkAdjustment *hadjustment = priv->hadjustment;
   GtkAdjustment *vadjustment = priv->vadjustment;
   GtkWidget *child;
@@ -522,21 +525,19 @@ gtk_viewport_size_allocate (GtkWidget     *widget,
   child = gtk_bin_get_child (GTK_BIN (widget));
   if (child && gtk_widget_get_visible (child))
     {
-      GtkAllocation child_allocation;
+      GtkAllocation child_allocation, child_clip;
 
       child_allocation.x = allocation->x - gtk_adjustment_get_value (hadjustment);
       child_allocation.y = allocation->y - gtk_adjustment_get_value (vadjustment);
       child_allocation.width = gtk_adjustment_get_upper (hadjustment);
       child_allocation.height = gtk_adjustment_get_upper (vadjustment);
 
-      gtk_widget_size_allocate (child, &child_allocation);
-      gtk_widget_get_clip (child, &clip);
+      /* Explicitly ignore the child clip here. */
+      gtk_widget_size_allocate (child, &child_allocation, -1, &child_clip);
     }
 
   g_object_thaw_notify (G_OBJECT (hadjustment));
   g_object_thaw_notify (G_OBJECT (vadjustment));
-
-  gtk_widget_set_clip (widget, &clip);
 }
 
 static void
index dcf3871d42ff74e82273e70dedf4a95d0f787d3a..dee81a70a0a6acf48285ce957635c9f78152d550 100644 (file)
@@ -619,8 +619,10 @@ static void        gtk_widget_real_map              (GtkWidget         *widget);
 static void    gtk_widget_real_unmap            (GtkWidget         *widget);
 static void    gtk_widget_real_realize          (GtkWidget         *widget);
 static void    gtk_widget_real_unrealize        (GtkWidget         *widget);
-static void    gtk_widget_real_size_allocate    (GtkWidget         *widget,
-                                                  GtkAllocation            *allocation);
+static void    gtk_widget_real_size_allocate    (GtkWidget               *widget,
+                                                  const GtkAllocation     *allocation,
+                                                  int                      baseline,
+                                                  GtkAllocation           *out_clip);
 static void    gtk_widget_real_direction_changed(GtkWidget         *widget,
                                                   GtkTextDirection   previous_direction);
 
@@ -1646,6 +1648,8 @@ gtk_widget_class_init (GtkWidgetClass *klass)
    * @widget: the object which received the signal.
    * @allocation: (type Gtk.Allocation): the region which has been
    *   allocated to the widget.
+   * @baseline: the baseline
+   * @out_clip: (type Gtk.Allocation): Return address for the widget's clip
    */
   widget_signals[SIZE_ALLOCATE] =
     g_signal_new (I_("size-allocate"),
@@ -1654,8 +1658,10 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_STRUCT_OFFSET (GtkWidgetClass, size_allocate),
                  NULL, NULL,
                  NULL,
-                 G_TYPE_NONE, 1,
-                 GDK_TYPE_RECTANGLE | G_SIGNAL_TYPE_STATIC_SCOPE);
+                 G_TYPE_NONE, 3,
+                 GDK_TYPE_RECTANGLE | G_SIGNAL_TYPE_STATIC_SCOPE,
+                  G_TYPE_INT,
+                  GDK_TYPE_RECTANGLE | G_SIGNAL_TYPE_STATIC_SCOPE);
 
   /**
    * GtkWidget::state-flags-changed:
@@ -5293,7 +5299,6 @@ gtk_widget_queue_draw_region (GtkWidget            *widget,
 {
   GtkWidget *parent;
   cairo_region_t *region2;
-  GtkAllocation alloc;
   int x, y;
   GtkCssStyle *parent_style;
   GtkBorder border, padding;
@@ -5324,7 +5329,6 @@ gtk_widget_queue_draw_region (GtkWidget            *widget,
   g_assert (parent != NULL);
 
   /* @region's coordinates are originally relative to @widget's origin */
-  gtk_widget_get_allocation (widget, &alloc);
   if (widget != parent)
     gtk_widget_translate_coordinates (_gtk_widget_get_parent (widget),
                                       parent,
@@ -5358,28 +5362,27 @@ invalidate:
 
 
 /**
- * gtk_widget_size_allocate_with_baseline:
+ * gtk_widget_size_allocate:
  * @widget: a #GtkWidget
  * @allocation: position and size to be allocated to @widget
  * @baseline: The baseline of the child, or -1
+ * @out_clip: (out): Return location for @widget's clip region. The returned clip
+ *   will be in the coordinate system of @widget's parent, just like @allocation.
  *
- * This function is only used by #GtkContainer subclasses, to assign a size,
+ * This function is only used by #GtkWidget subclasses, to assign a size,
  * position and (optionally) baseline to their child widgets.
  *
- * In this function, the allocation and baseline may be adjusted. It
- * will be forced to a 1x1 minimum size, and the
- * adjust_size_allocation virtual and adjust_baseline_allocation
- * methods on the child will be used to adjust the allocation and
- * baseline. Standard adjustments include removing the widget's
- * margins, and applying the widget’s #GtkWidget:halign and
- * #GtkWidget:valign properties.
+ * In this function, the allocation and baseline may be adjusted. The given
+ * allocation will be forced to be bigger than the widget's minimum size,
+ * as well as at least 1×1 in size.
  *
  * Since: 3.10
  **/
 void
-gtk_widget_size_allocate_with_baseline (GtkWidget     *widget,
-                                       GtkAllocation *allocation,
-                                       gint           baseline)
+gtk_widget_size_allocate (GtkWidget           *widget,
+                          const GtkAllocation *allocation,
+                          int                  baseline,
+                          GtkAllocation       *out_clip)
 {
   GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
   GdkRectangle real_allocation;
@@ -5393,14 +5396,21 @@ gtk_widget_size_allocate_with_baseline (GtkWidget     *widget,
   gint min_width, min_height;
   GtkCssStyle *style;
   GtkBorder margin, border, padding;
+  GtkAllocation new_clip;
 
   g_return_if_fail (GTK_IS_WIDGET (widget));
-
-  if (!priv->visible && !_gtk_widget_is_toplevel (widget))
-    return;
+  g_return_if_fail (baseline >= -1);
+  g_return_if_fail (out_clip != NULL);
+  g_return_if_fail (allocation != NULL);
 
   gtk_widget_push_verify_invariants (widget);
 
+  if (!priv->visible && !_gtk_widget_is_toplevel (widget))
+    {
+      memset (out_clip, 0, sizeof (GdkRectangle));
+      goto out;
+    }
+
 #ifdef G_ENABLE_DEBUG
   if (GTK_DISPLAY_DEBUG_CHECK (gtk_widget_get_display (widget), RESIZE))
     {
@@ -5424,10 +5434,10 @@ gtk_widget_size_allocate_with_baseline (GtkWidget     *widget,
       depth = 0;
       parent = widget;
       while (parent)
-       {
-         depth++;
-         parent = _gtk_widget_get_parent (parent);
-       }
+        {
+          depth++;
+          parent = _gtk_widget_get_parent (parent);
+        }
 
       name = g_type_name (G_OBJECT_TYPE (G_OBJECT (widget)));
       g_message ("gtk_widget_size_allocate: %*s%s %d %d %d %d, baseline %d",
@@ -5542,11 +5552,27 @@ gtk_widget_size_allocate_with_baseline (GtkWidget     *widget,
 
   /* Set the widget allocation to real_allocation now, pass the smaller allocation to the vfunc */
   priv->allocation = real_allocation;
-  priv->clip = real_allocation;
   priv->allocated_baseline = baseline;
 
   if (!alloc_needed && !size_changed && !baseline_changed)
-    goto out;
+    {
+      gtk_widget_set_clip (widget, &priv->reported_clip);
+      *out_clip = priv->clip;
+
+      /* Still have to move the window... */
+      if (_gtk_widget_get_realized (widget) &&
+          _gtk_widget_get_has_window (widget))
+         {
+           GtkAllocation window_alloc;
+
+           gtk_widget_get_window_allocation (widget, &window_alloc);
+           gdk_window_move_resize (priv->window,
+                                   window_alloc.x, window_alloc.y,
+                                   window_alloc.width, window_alloc.height);
+         }
+
+      goto check_clip;
+    }
 
   /* Since gtk_widget_measure does it for us, we can be sure here that
    * the given alloaction is large enough for the css margin/bordder/padding */
@@ -5556,11 +5582,18 @@ gtk_widget_size_allocate_with_baseline (GtkWidget     *widget,
                            margin.right + border.right + padding.right;
   real_allocation.height -= margin.top + border.top + padding.top +
                             margin.bottom + border.bottom + padding.bottom;
+  new_clip = real_allocation;
 
   if (g_signal_has_handler_pending (widget, widget_signals[SIZE_ALLOCATE], 0, FALSE))
-    g_signal_emit (widget, widget_signals[SIZE_ALLOCATE], 0, &real_allocation);
+    g_signal_emit (widget, widget_signals[SIZE_ALLOCATE], 0,
+                   &real_allocation,
+                   baseline,
+                   &new_clip);
   else
-    GTK_WIDGET_GET_CLASS (widget)->size_allocate (widget, &real_allocation);
+    GTK_WIDGET_GET_CLASS (widget)->size_allocate (widget,
+                                                  &real_allocation,
+                                                  baseline,
+                                                  &new_clip);
 
   /* Size allocation is god... after consulting god, no further requests or allocations are needed */
 #ifdef G_ENABLE_DEBUG
@@ -5570,10 +5603,16 @@ gtk_widget_size_allocate_with_baseline (GtkWidget     *widget,
                  gtk_widget_get_name (widget), widget);
     }
 #endif
+
+  priv->reported_clip = new_clip;
+  gtk_widget_set_clip (widget, &priv->reported_clip);
+  *out_clip = priv->clip;
+
   gtk_widget_ensure_resize (widget);
   priv->alloc_needed = FALSE;
   priv->alloc_needed_on_child = FALSE;
 
+check_clip:
   size_changed |= (old_clip.width != priv->clip.width ||
                    old_clip.height != priv->clip.height);
   position_changed |= (old_clip.x != priv->clip.x ||
@@ -5611,31 +5650,6 @@ out:
   gtk_widget_pop_verify_invariants (widget);
 }
 
-
-/**
- * gtk_widget_size_allocate:
- * @widget: a #GtkWidget
- * @allocation: position and size to be allocated to @widget
- *
- * This function is only used by #GtkContainer subclasses, to assign a size
- * and position to their child widgets.
- *
- * In this function, the allocation may be adjusted. It will be forced
- * to a 1x1 minimum size, and the adjust_size_allocation virtual
- * method on the child will be used to adjust the allocation. Standard
- * adjustments include removing the widget’s margins, and applying the
- * widget’s #GtkWidget:halign and #GtkWidget:valign properties.
- *
- * For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline()
- * instead.
- **/
-void
-gtk_widget_size_allocate (GtkWidget    *widget,
-                         GtkAllocation *allocation)
-{
-  gtk_widget_size_allocate_with_baseline (widget, allocation, -1);
-}
-
 /**
  * gtk_widget_common_ancestor:
  * @widget_a: a #GtkWidget
@@ -5768,17 +5782,22 @@ gtk_widget_translate_coordinates (GtkWidget  *src_widget,
 }
 
 static void
-gtk_widget_real_size_allocate (GtkWidget     *widget,
-                              GtkAllocation *allocation)
+gtk_widget_real_size_allocate (GtkWidget           *widget,
+                               const GtkAllocation *allocation,
+                               int                  baseline,
+                               GtkAllocation       *out_clip)
 {
-  GtkWidgetPrivate *priv = widget->priv;
+  GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
 
   if (_gtk_widget_get_realized (widget) &&
       _gtk_widget_get_has_window (widget))
      {
-       gdk_window_move_resize (priv->window,
-                               allocation->x, allocation->y,
-                               allocation->width, allocation->height);
+       GtkAllocation window_alloc;
+
+       gtk_widget_get_window_allocation (widget, &window_alloc);
+       gdk_window_move_resize (priv->window,
+                               window_alloc.x, window_alloc.y,
+                               window_alloc.width, window_alloc.height);
      }
 }
 
@@ -13127,70 +13146,63 @@ gtk_widget_set_clip (GtkWidget           *widget,
 {
   GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
   GtkBorder shadow;
-  GtkAllocation allocation;
-  GtkBorder margin, border, padding;
+  GtkBorder margin;
   GtkCssStyle *style;
   GdkRectangle new_clip;
+  GtkAllocation allocation;
 
   g_return_if_fail (GTK_IS_WIDGET (widget));
   g_return_if_fail (_gtk_widget_get_visible (widget) || _gtk_widget_is_toplevel (widget));
   g_return_if_fail (clip != NULL);
 
+  style = gtk_css_node_get_style (priv->cssnode);
+  get_box_margin (style, &margin);
+  _gtk_css_shadows_value_get_extents (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BOX_SHADOW), &shadow);
+
+  /* The given clip is in @widget's coordinates, but we need it to be in the parent's coordinates,
+   * just like priv->allocation is. So first we transform the clip, then union it with
+   * the allocation (minus css margins) and then we add the box shadow size. */
+  new_clip = *clip;
+  new_clip.x += priv->allocation.x + margin.left;
+  new_clip.y += priv->allocation.y + margin.top;
+
+  allocation = priv->allocation;
+  allocation.x += margin.left;
+  allocation.y += margin.top;
+  allocation.width -= margin.left + margin.right;
+  allocation.height -= margin.top + margin.bottom;
+
+  gdk_rectangle_union (&allocation, &new_clip, &priv->clip);
+  priv->clip.x -= shadow.left;
+  priv->clip.y -= shadow.top;
+  priv->clip.width += shadow.left + shadow.right;
+  priv->clip.height += shadow.top + shadow.bottom;
+
 #ifdef G_ENABLE_DEBUG
   if (GTK_DEBUG_CHECK (GEOMETRY))
     {
       gint depth;
       GtkWidget *parent;
       const gchar *name;
+      const char *cssname;
 
       depth = 0;
       parent = widget;
       while (parent)
-       {
-         depth++;
-         parent = _gtk_widget_get_parent (parent);
-       }
+        {
+          depth++;
+          parent = _gtk_widget_get_parent (parent);
+        }
 
       name = g_type_name (G_OBJECT_TYPE (G_OBJECT (widget)));
-      g_message ("gtk_widget_set_clip:      %*s%s %d %d %d %d",
-                2 * depth, " ", name,
-                clip->x, clip->y,
-                clip->width, clip->height);
+      cssname = gtk_css_node_get_name (priv->cssnode);
+      g_message ("gtk_widget_set_clip:      %s %s %d %d %d %d",
+                 name,
+                 cssname,
+                 priv->clip.x, priv->clip.y,
+                 priv->clip.width, priv->clip.height);
     }
 #endif /* G_ENABLE_DEBUG */
-
-
-  /* The given clip is relative to the widget's origin, but we union
-   * it with priv->allocation, which is the orgin minus CSS padding, border and margin.
-   * Additionally, the box shadow is drawn around the widget's border box */
-
-  style = gtk_css_node_get_style (priv->cssnode);
-  allocation = priv->allocation;
-  get_box_margin (style, &margin);
-  get_box_margin (style, &border);
-  get_box_margin (style, &padding);
-  _gtk_css_shadows_value_get_extents (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BOX_SHADOW), &shadow);
-
-  /* Get border box from allocation */
-  allocation.x += margin.left;
-  allocation.y += margin.top;
-  allocation.width -= margin.left + margin.right;
-  allocation.height -= margin.top + margin.bottom;
-
-  /* Add box shadow size to border box */
-  allocation.x -= shadow.left;
-  allocation.y -= shadow.top;
-  allocation.width += shadow.left + shadow.right;
-  allocation.height += shadow.top + shadow.bottom;
-
-  /* Transform clip into coordinate space of priv->allocation */
-  new_clip = *clip;
-  new_clip.x += priv->allocation.x + border.left + padding.left;
-  new_clip.y += priv->allocation.y + border.top  + padding.top;
-  new_clip.width -= margin.left + margin.right;
-  new_clip.height -= margin.top + margin.bottom;
-
-  gdk_rectangle_union (&allocation, &new_clip, &priv->clip);
 }
 
 /**
@@ -13202,7 +13214,7 @@ gtk_widget_set_clip (GtkWidget           *widget,
  * Retrieves the widget’s allocated size.
  *
  * This function returns the last values passed to
- * gtk_widget_size_allocate_with_baseline(). The value differs from
+ * gtk_widget_size_allocate(). The value differs from
  * the size returned in gtk_widget_get_allocation() in that functions
  * like gtk_widget_set_halign() can adjust the allocation, but not
  * the value returned by this function.
@@ -13887,10 +13899,11 @@ gtk_widget_ensure_allocate (GtkWidget *widget)
   if (priv->alloc_needed)
     {
       GtkAllocation allocation;
+      GtkAllocation clip;
       int baseline;
 
       gtk_widget_get_allocated_size (widget, &allocation, &baseline);
-      gtk_widget_size_allocate_with_baseline (widget, &allocation, baseline);
+      gtk_widget_size_allocate (widget, &allocation, baseline, &clip);
     }
   else if (priv->alloc_needed_on_child)
     {
index 536a19c9909c17ac63bae28bd664e9c00794851f..c677aa59ff8f2c778c00d583f7de709265d5b5c2 100644 (file)
@@ -302,8 +302,10 @@ struct _GtkWidgetClass
   void (* unmap)              (GtkWidget        *widget);
   void (* realize)            (GtkWidget        *widget);
   void (* unrealize)          (GtkWidget        *widget);
-  void (* size_allocate)       (GtkWidget        *widget,
-                               GtkAllocation    *allocation);
+  void (* size_allocate)       (GtkWidget           *widget,
+                                const GtkAllocation *allocation,
+                                int                  baseline,
+                                GtkAllocation       *out_clip);
   void (* state_flags_changed) (GtkWidget        *widget,
                                GtkStateFlags     previous_state_flags);
   void (* parent_set)         (GtkWidget        *widget,
@@ -542,12 +544,10 @@ GDK_AVAILABLE_IN_3_8
 GdkFrameClock* gtk_widget_get_frame_clock (GtkWidget           *widget);
 
 GDK_AVAILABLE_IN_ALL
-void      gtk_widget_size_allocate       (GtkWidget           *widget,
-                                          GtkAllocation       *allocation);
-GDK_AVAILABLE_IN_3_10
-void      gtk_widget_size_allocate_with_baseline         (GtkWidget           *widget,
-                                                          GtkAllocation       *allocation,
-                                                          gint                 baseline);
+void      gtk_widget_size_allocate       (GtkWidget           *widget,
+                                           const GtkAllocation *allocation,
+                                           int                  baseline,
+                                           GtkAllocation       *out_clip);
 
 GDK_AVAILABLE_IN_ALL
 GtkSizeRequestMode  gtk_widget_get_request_mode               (GtkWidget      *widget);
index 30b045a0084127be8622aebe857e36670ff2f574..86b020f6aeec6675aa1821b9122dc9af50f0759a 100644 (file)
@@ -94,8 +94,6 @@ struct _GtkWidgetPrivate
   guint   halign              : 4;
   guint   valign              : 4;
 
-  guint clip_set : 1;
-
   guint8 alpha;
   guint8 user_alpha;
 
@@ -139,6 +137,7 @@ struct _GtkWidgetPrivate
   gint allocated_size_baseline;
   GtkAllocation allocation;
   GtkAllocation clip;
+  GtkAllocation reported_clip;
   gint allocated_baseline;
 
   /* The widget's requested sizes */
index ac1513cc12885668deef3e56b15c020186ad49f6..cf1e71ec5dcd89be4638b164d394ec728f74599f 100644 (file)
@@ -406,8 +406,10 @@ static void gtk_window_map                (GtkWidget         *widget);
 static void gtk_window_unmap              (GtkWidget         *widget);
 static void gtk_window_realize            (GtkWidget         *widget);
 static void gtk_window_unrealize          (GtkWidget         *widget);
-static void gtk_window_size_allocate      (GtkWidget         *widget,
-                                          GtkAllocation     *allocation);
+static void gtk_window_size_allocate      (GtkWidget           *widget,
+                                           const GtkAllocation *allocation,
+                                           int                  baseline,
+                                           GtkAllocation       *out_clip);
 static gboolean gtk_window_map_event      (GtkWidget         *widget,
                                            GdkEventAny       *event);
 static gint gtk_window_configure_event    (GtkWidget         *widget,
@@ -6706,6 +6708,7 @@ gtk_window_realize (GtkWidget *widget)
       allocation.height == 1)
     {
       GdkRectangle request;
+      GdkRectangle clip;
 
       gtk_window_compute_configure_request (window, &request, NULL, NULL);
 
@@ -6713,7 +6716,7 @@ gtk_window_realize (GtkWidget *widget)
       allocation.y = 0;
       allocation.width = request.width;
       allocation.height = request.height;
-      gtk_widget_size_allocate (widget, &allocation);
+      gtk_widget_size_allocate (widget, &allocation, -1, &clip);
 
       gtk_widget_queue_resize (widget);
 
@@ -6929,12 +6932,13 @@ popover_size_allocate (GtkWidget        *widget,
                        GtkWindow        *window)
 {
   cairo_rectangle_int_t rect;
+  GtkAllocation clip;
 
   if (GTK_IS_POPOVER (popover->widget))
     gtk_popover_update_position (GTK_POPOVER (popover->widget));
 
   popover_get_rect (popover, window, &rect);
-  gtk_widget_size_allocate (widget, &rect);
+  gtk_widget_size_allocate (widget, &rect, -1, &clip);
 }
 
 /* _gtk_window_set_allocation:
@@ -7001,6 +7005,7 @@ _gtk_window_set_allocation (GtkWindow           *window,
       !priv->fullscreen)
     {
       GtkAllocation title_allocation;
+      GtkAllocation title_clip;
 
       title_allocation.x = window_border.left;
       title_allocation.y = window_border.top;
@@ -7015,7 +7020,7 @@ _gtk_window_set_allocation (GtkWindow           *window,
 
       title_allocation.height = priv->title_height;
 
-      gtk_widget_size_allocate (priv->title_box, &title_allocation);
+      gtk_widget_size_allocate (priv->title_box, &title_allocation, -1, &title_clip);
     }
 
   if (priv->decorated &&
@@ -7048,8 +7053,10 @@ _gtk_window_set_allocation (GtkWindow           *window,
 }
 
 static void
-gtk_window_size_allocate (GtkWidget     *widget,
-                          GtkAllocation *allocation)
+gtk_window_size_allocate (GtkWidget           *widget,
+                          const GtkAllocation *allocation,
+                          int                  baseline,
+                          GtkAllocation       *out_clip)
 {
   GtkWindow *window = GTK_WINDOW (widget);
   GtkWidget *child;
@@ -7059,9 +7066,7 @@ gtk_window_size_allocate (GtkWidget     *widget,
 
   child = gtk_bin_get_child (GTK_BIN (window));
   if (child && gtk_widget_get_visible (child))
-    gtk_widget_size_allocate (child, &child_allocation);
-
-  gtk_widget_set_clip (widget, allocation);
+    gtk_widget_size_allocate (child, &child_allocation, -1, out_clip);
 }
 
 static gint
@@ -8689,6 +8694,7 @@ gtk_window_move_resize (GtkWindow *window)
   if (priv->configure_notify_received)
     {
       GtkAllocation allocation;
+      GtkAllocation clip;
       int min;
 
       /* If we have received a configure event since
@@ -8706,7 +8712,6 @@ gtk_window_move_resize (GtkWindow *window)
 
       allocation.x = 0;
       allocation.y = 0;
-      /*allocation.width = current_width;*/
 
       gtk_widget_measure (widget, GTK_ORIENTATION_HORIZONTAL, -1,
                           &min, NULL, NULL, NULL);
@@ -8715,7 +8720,7 @@ gtk_window_move_resize (GtkWindow *window)
                           &min, NULL, NULL, NULL);
       allocation.height = MAX (min, current_height);
 
-      gtk_widget_size_allocate (widget, &allocation);
+      gtk_widget_size_allocate (widget, &allocation, -1, &clip);
 
       /* If the configure request changed, it means that
        * we either:
@@ -8790,7 +8795,8 @@ gtk_window_move_resize (GtkWindow *window)
 
       if (priv->type == GTK_WINDOW_POPUP)
         {
-         GtkAllocation allocation;
+          GtkAllocation allocation;
+          GtkAllocation clip;
 
          /* Directly size allocate for override redirect (popup) windows. */
           allocation.x = 0;
@@ -8798,7 +8804,7 @@ gtk_window_move_resize (GtkWindow *window)
          allocation.width = new_request.width;
          allocation.height = new_request.height;
 
-         gtk_widget_size_allocate (widget, &allocation);
+          gtk_widget_size_allocate (widget, &allocation, -1, &clip);
        }
       else
         {
@@ -8826,7 +8832,7 @@ gtk_window_move_resize (GtkWindow *window)
     }
   else
     {
-      GtkAllocation allocation;
+      GtkAllocation allocation, clip;
 
       /* Handle any position changes.
        */
@@ -8844,7 +8850,7 @@ gtk_window_move_resize (GtkWindow *window)
       allocation.width = current_width;
       allocation.height = current_height;
 
-      gtk_widget_size_allocate (widget, &allocation);
+      gtk_widget_size_allocate (widget, &allocation, -1, &clip);
     }
   
   /* We have now processed a move/resize since the last position
index c0d579830880965356b39696ca62a747a6002ea5..7bbaa1b8cd6b2649cee000c1f058344facea1da4 100644 (file)
@@ -249,16 +249,13 @@ gtk_stack_combo_snapshot (GtkWidget   *widget,
 }
 
 static void
-gtk_stack_combo_size_allocate (GtkWidget     *widget,
-                               GtkAllocation *allocation)
+gtk_stack_combo_size_allocate (GtkWidget           *widget,
+                               const GtkAllocation *allocation,
+                               int                  baseline,
+                               GtkAllocation       *out_clip)
 {
   GtkStackCombo *self = GTK_STACK_COMBO (widget);
-  GtkAllocation clip = *allocation;
-
-  gtk_widget_size_allocate (GTK_WIDGET (self->combo), allocation);
-  gtk_widget_get_clip (GTK_WIDGET (self->combo), &clip);
-
-  gtk_widget_set_clip (widget, &clip);
+  gtk_widget_size_allocate (GTK_WIDGET (self->combo), allocation, baseline, out_clip);
 }
 
 static void
index a26f57bda6653740b3de19993f692d1e6c9fa335..2c364187a3e56c615abcab7ae78bd6e71a90d461 100644 (file)
@@ -135,7 +135,11 @@ state_flags_changed (GtkWidget *w, GtkStateFlags old_flags, GtkInspectorMiscInfo
 }
 
 static void
-allocation_changed (GtkWidget *w, GdkRectangle *allocation, GtkInspectorMiscInfo *sl)
+allocation_changed (GtkWidget    *w,
+                    GdkRectangle *allocation,
+                    int           baseline,
+                    GdkRectangle *out_clip,
+                    GtkInspectorMiscInfo *sl)
 {
   GtkAllocation alloc;
   GtkAllocation clip;
@@ -467,7 +471,7 @@ gtk_inspector_misc_info_set_object (GtkInspectorMiscInfo *sl,
       state_flags_changed (GTK_WIDGET (sl->priv->object), 0, sl);
 
       g_signal_connect_object (object, "size-allocate", G_CALLBACK (allocation_changed), sl, 0);
-      allocation_changed (GTK_WIDGET (sl->priv->object), NULL, sl);
+      allocation_changed (GTK_WIDGET (sl->priv->object), NULL, -1, NULL, sl);
     }
   else
     {
index 780f652140a5bfde39e37fd6c010c43a7691b78a..97e3074ea0432fe0221c9edd03dcf64d9df122dc 100644 (file)
@@ -84,7 +84,10 @@ GType gtk_focus_widget_get_type (void) G_GNUC_CONST;
 G_DEFINE_TYPE(GtkFocusWidget, gtk_focus_widget, GTK_TYPE_WIDGET)
 
 static void
-gtk_focus_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
+gtk_focus_widget_size_allocate (GtkWidget           *widget,
+                                const GtkAllocation *allocation,
+                                int                  baseline,
+                                GtkAllocation       *out_clip)
 {
   GtkFocusWidget *self = GTK_FOCUS_WIDGET (widget);
   int child_width  = (allocation->width)  / 2;
@@ -96,19 +99,19 @@ gtk_focus_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
   child_alloc.width = child_width;
   child_alloc.height = child_height;
 
-  gtk_widget_size_allocate (self->child1, &child_alloc);
+  gtk_widget_size_allocate (self->child1, &child_alloc, -1, out_clip);
 
   child_alloc.x += child_width;
 
-  gtk_widget_size_allocate (self->child2, &child_alloc);
+  gtk_widget_size_allocate (self->child2, &child_alloc, -1, out_clip);
 
   child_alloc.y += child_height;
 
-  gtk_widget_size_allocate (self->child4, &child_alloc);
+  gtk_widget_size_allocate (self->child4, &child_alloc, -1, out_clip);
 
   child_alloc.x -= child_width;
 
-  gtk_widget_size_allocate (self->child3, &child_alloc);
+  gtk_widget_size_allocate (self->child3, &child_alloc, -1, out_clip);
 }
 
 static void